[Zope] Help with dtml-let & dtml-if

Andrew Diller dillera@isc.upenn.edu
Wed, 29 Mar 2000 20:21:07 -0500


Thanks, of course, this worked exactly as I needed.

>  
> > Say I want to initialize a counter, and change it from 0 1 each iteration of a loop.
> 
> Let me warn you, you are allready thinking too procedurally.  Remeber
> DTML is a _template_ language.
>  
> 
> What you are doing is easily done using the 'sequence-even' attribute.
> 
> <dtml-in "getElementsByTagName('book')" >
>   <dtml-if sequence-even>
>     Print stuff for even rows
>   <dtml-else>
>     Print stuff for odd rows.
>   </dtml-if>
> </dtml-in>
> 
> -Michel