[ZPT] DTML call ZPT?

Evan Simpson evan@zope.com
Fri, 01 Mar 2002 09:41:22 -0500


alan runyan wrote:
> I want to call a macro from DTML.  Is this possible?   <dtml-var
> "template.macros['macro']"> renders the raw
> program and macros ;(  how can I get the 'expected' results?

Best way I can think of offhand is to write a rendering template, like so:

<div metal:use-macro="python:path('%(template)s/macros/%(macro)s' % 
options)" />

Then you can call it like:

<dtml-var expr="macro_render(template='here/foo', macro='bar')">

Cheers,

Evan @ Zope