[Zope] Sequence-Item

Martijn Faassen faassen@vet.uu.nl
Mon, 29 Oct 2001 13:10:24 +0100


Ben Ocean wrote:
> At 06:31 PM 10/28/01 +0100, you wrote:
> >Try using <dtml-if "_['sequence-item']==...  instead of <dtml-if 
> >"sequence-item==....
> 
> Worked like a charm, thank you!

These days, instead of the fairly horrible hard to explain _['sequence-item']
you can use 'prefix' instead, like this. The problem is that - in Python
means substraction and therefore cannot be part of a name, and due to
historical reasons Zope does use the - in DTML as part of names. The
prefix knob fixes this as it makes dtml-in use an underscore instead:

<dtml-in something prefix="seq">
  <dtml-var seq_item>
</dtml-in>

See also the online DTML help on 'in'.

Regards,

Martijn