[Product-Developers] variable expression in metal:use-macro

Andreas Petermann petepetermann at googlemail.com
Sat Jan 17 17:03:54 UTC 2009


OK, i found an example for this problem in fields.pt
> Hi list,
>
> is it possible to use a variable expression in metal:use-macro 
> statements? For example:
>
> <div tal:define="path_to_macro python:here.pathToMacro()">
>    <div metal:use-macro="path_to_macro"></div>
> </div>
<div tal:define="widget_macro python:path('here/%s/macros/%s' % 
(widget.pathToMacro(), widget.mode()))">
   <div metal:use-macro="widget_macro"></div>
</div>

Andreas Petermann




More information about the Product-Developers mailing list