[Zope] calling macros
Marius Gleeson
mg at subscribe.audumla.net
Tue Apr 20 08:03:30 EDT 2004
Yes I understand that. However the macro that I am calling uses the
'here' object, which references the object defined outside the loop, not
the one that is referenced by 'obj'. What I want to do is to call the
macro so that the 'here' reference is now set to the same object as 'obj'
Thanks.
On Tue, 20 Apr 2004 12:24:38 +0200, "Geir Bækholt" <lists at elvix.com>
said:
> Marius,
> Tuesday, April 20, 2004, 8:54:36 AM, you wrote:
>
> > I am calling a macro that reference the 'here' variable within python
> > scripts. However the I am calling the macro from within a tal:repeat
> > block. So the here object within the macro is not the object that I want
> > to be working with. Can anyone tell me how I should be doing this so that
> > macro is referencing the correct object.
>
> > <metal:block tal:repeat="obj folderContents">
> > <dd>
> > <div tal:condition="python: obj.portal_type == 'News Item'">
> > <metal:use use-macro="here/newsitem_view/macros/main"/>
> > </div>
> > </dd>
> > </metal:block>
>
> obj
>
> The macro is expanded before tal-statements are evaluated, so whatever
> variables defined outside the macro are available.
>
>
> --
> __________________________________________________________________
>
> Geir Bækholt · Interaction Engineer · Plone Solutions
>
> Development · Training · Support · http://www.plonesolutions.com
> __________________________________________________________________
>
More information about the Zope
mailing list