[Zope-CMF] simple (I think :-) TAL/python expression question
gmane
larry_prikockis@natureserve.org
Tue, 10 Jun 2003 16:23:50 -0400
I have the following snippet of code:
(the "nwType" and such relate to a javascript menu library I'm using)
--------------
<div nwType="menuComponent" width="150">
<metal:block tal:repeat="item menu_items">
<div tal:condition="python:item.folder_type == 'division'"
nwType="menuNode" tal:attributes="dispText item/Title; action
string:window.location='${portal_url}/${item/getId}';">
</div>
</metal:block>
</div>
----------------
my question is, how do I code the "python:item.folder_type == ????? " line
so that instead of the hard-coded 'division' string, I'm comparing against a
"tal:define=blah tab/id" statement earlier? Actually, I'm assuming I need
to make the defined variable global, but I can't come to grips with the
syntax for the python expression.
and of course, I realize this whole ugly ball of code probably needs to be
moved out of the template and into a script... but I'm saving that for my
next trick :-)
thanks for any clues anyone can provide...
Larry