On Tue, Oct 21, 2008 at 11:16, Kornel Lesiński
>> I dont know if there are any drawbacks — cache, optimisation, etc?
> If you're just trying to implement eval() in TAL, then don't do it - it's
> just asking for trouble (bugs in macro generation code could allow code
> injection).


> Maybe you could just write one flexible macro that works with more than one
> specific dataset?

I don`t think it is possible. ;-) It relies too much on the user input.

For example, the content of the page (markdown syntax) can be
extended with some data from atom feed. But I dont know WHERE
to insert this data. The user could write something like:

   This is paragraph

   <tal:block metal:use-macro="atom/contents" tal:define="entry feeds/main/2" />
     -- this will be replaced with contents of main atom feed, second entry.

  or some pseudosyntax like: [insert CONTENTS from main/2]

And all of the above is *content*, insertet to the template using:

   <tal:block tal:content="structure markdown: content" />

So i guess the best solution is to use another expression modifier?

  <tal:block tal:content="structure markdown: expand_atom: content" />

(i don`t know if they can be chained, but thats not a problem)
And in the modifier I have access to my data via $ctx object, right?

Maciej Łebkowski, http://lebkowski.info/kontakt.php
PHPTAL mailing list

Reply via email to