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

Andrew Diller dillera@isc.upenn.edu
Wed, 29 Mar 2000 19:53:55 -0500


Hello:

I'm not getting dtml-let. I use it to create a variable that I can access, correct?

Say I want to initialize a counter, and change it from 0 1 each iteration of a loop.

This will print out rows of a table with alternating background colors:


<dtml-let x=0>
</dtml-let>

<dtml-in "getElementsByTagName('book')" >

<dtml-if x==0>
	<tr bgcolor="DDEEAC">
<dtml-else>
	<tr>
</dtml-if>


write out some html

</tr>

<dtml-if x==0>
	<dtml-let x=1>
	</dtml-let>
<dtml-else>
	<dtml-let x=0>
	</dtml-let>
</dtml-if>

</dtml-in>
</table>
</dtml-with>



The let and if syntax is not good, and I can't read anywhere on how you would accomplish this type of
construct.

-andy