[Zope] List of objects

alan runyan runyaga@thisbox.com
Wed, 28 Mar 2001 20:49:34 -0600


Dimitris,

<dtml-in "['Jim', 'Alan', 'Bob']">
    hello <dtml-var sequence-item>
</dtml-in>

NOTE: the <dtml-in "PYTHON EXPRESSIONS ARE IN QUOTATIONS">
also note how sequence-item is NOT in quotes, the sequence-item variable is
understood in the DTML namespace but not in the python namespace.
if you tried <dtml-var "sequence-item">, your essentially saying,  print
sequence - item
and you will get a NameError.  try this:

<dtml-call "REQUEST.set('sequence', 2)">
<dtml-call "REQUEST.set('item', 1)">
<dtml-var "sequence-item">
sequence=2
item=1
print sequence - item

<dtml-with friends> <!-- friends being a container, having document Jim,
Alan, Bob -->
<dtml-in ['Jim', 'Alan', 'Bob']> <!--these objects exist in the friends
container-->
  <dtml-var sequence-item> <!--this renders the Jim and party object in the
container-->
</dtml-in>

please look at the <a href="http://www.zope.org/Members/michel/ZB/">ZOPE
book</a>.  its full of goodies.
you kinda have to learn a little about python to be productive in ZOPE (dont
worry Python is the easiest language I've encountered), but
you will constantly trip over Python vs DTML (hurdle 1) and then mastering
The Namespace (hurdle 2), then armed with that you can
work on your Acquisition (hurdle 3, which cant be fully understood w/o the
previous 2 steps, IMO).

~runyaga