How to define variables inside a loop in Zope Page Template
Hi, Why this line doesn't work? <span tal:repeat="item here/objectValues" tal:define="header item/title"> It complains unable to fine 'item'. Cheers Dirksen __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
From Evans ZPT article:
The order in which you write TAL attributes on a tag does not affect the order in which they execute. No matter how you arrange them, the TAL statements on a tag always execute in the following order: define, condition, repeat, content / replace, attributes. So in your case you must define 'header' inside the repeat block. Andreas ----- Original Message ----- From: "Dirksen" <dirksen_lau@yahoo.com> To: <zope@zope.org> Sent: Samstag, 4. August 2001 06:30 Subject: [Zope] How to define variables inside a loop in Zope Page Template
Hi,
Why this line doesn't work? <span tal:repeat="item here/objectValues" tal:define="header item/title">
It complains unable to fine 'item'.
Cheers Dirksen
__________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
From: "Dirksen" <dirksen_lau@yahoo.com>
Why this line doesn't work? <span tal:repeat="item here/objectValues" tal:define="header item/title">
Because TAL doesn't pay attention to the order in which attributes appear in a tag. It *always* peforms tal:define before tal:repeat on the same tag. You will need to either place the tal:define on an enclosed tag, or place the tal:repeat on an enclosing tag. Cheers, Evan @ 4-am
participants (3)
-
Andreas Jung -
Dirksen -
Evan Simpson