[Zope] Re: trying to understand ZPT macros...

Evan Simpson evan@4-am.com
Wed, 08 Jan 2003 10:06:42 -0600


Anthony Baxter wrote:
> <div class="lgOther" 
>      metal:use-macro="macros/renderLinkGroup"
>      tal:define="linkgroup python:blog.linkGroups.get('blogs')"/>
> 
> I get a keyerror on 'linkgroup' in the macro definition...

That's because the metal:use-macro replaces the entire <div> with the 
macro before the tal:define has a chance to do anything (it also blows 
away your "class" attribute).  This should work if you change it to:

<div tal:define="linkgroup python:blog.linkGroups.get('blogs')">
<div metal:use-macro="macros/renderLinkGroup"></div>
</div>

Cheers,

Evan @ 4-am