[Zope] Re: returning a macro from a pythonscript
Gaute Amundsen
gaute at div.org
Fri Mar 2 10:42:10 EST 2007
On Friday 02 March 2007 13:35, jerome prudent wrote:
> What do you want to do with your macro?
>
The usual. Have it display some html :)
I return remplates from scripts all the time, and find it very usefull.
return index_html(foo=bar)
On Friday 02 March 2007 13:41, Tonico Strasser wrote:
> Gaute Amundsen schrieb:
> > foo = restrictedTraverse('/foo/bar/index.html/macros/mymacro')
>
> You can use this macro in a template.
>
> <div metal:use-macro="foo"/>
Yes, I know.
I could have a "wrapper template" containing only the "use macro", and return
that instead, but that's a bit ugly, and just what I wanted to avoid.
The purpose of this is to reuse part of a "regular" template in an ajax call.
Gaute.
More information about the Zope
mailing list