[ZPT] Repeat variables in macros

Evan Simpson evan@4-am.com
Wed, 19 Mar 2003 12:51:31 -0600


Kevin Smith wrote:
> <table>
> <tr tal:repeat="line python:['a','b','c']">
>    <td metal:use-macro="template/macros/foo">macro content</td>
> </tr>
> </table>
> 
> <metal:block metal:define-macro="foo">
>    <td tal:content="line">line stuff</td>
> </metal:block>

Don't forget... the macro definition is not inert, it is a normal part 
of your page.  When it is executed, 'line' is not defined.

You can fix this either by defining 'line' for the macro, or by changing 
the tal:content to "line | nothing".

Cheers,

Evan @ 4-am