Use ZPT repeat variables (<a href="http://www.plope.com/Books/2_7Edition/AdvZPT.stx#2-3">http://www.plope.com/Books/2_7Edition/AdvZPT.stx#2-3</a>).<br><br><br><div><span class="gmail_quote">2007/7/30, Peter Bengtsson &lt;<a href="mailto:peter@fry-it.com">
peter@fry-it.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You can use the ZTUtils Iterator()<br><br><br>&lt;div tal:define=&quot;iter python:modules[&#39;ZTUtils&#39;].Iterator(range(1000))&quot;&gt;
<br>&nbsp;&nbsp; &lt;br tal:define=&quot;dummy iter/next&quot; tal:replace=&quot;iter/number&quot; /&gt;<br>&nbsp;&nbsp; &lt;br tal:define=&quot;dummy iter/next&quot; tal:replace=&quot;iter/number&quot; /&gt;<br>&nbsp;&nbsp; &lt;br tal:define=&quot;dummy iter/next&quot; tal:replace=&quot;iter/number&quot; /&gt;
<br>&lt;/div&gt;<br><br>Which might give you some freedom such as iter/Roman or iter/odd<br>The above is practically the same as:<br><br>&nbsp;&nbsp; &lt;br tal:repeat=&quot;i python:range(3)&quot; tal:replace=&quot;i&quot; /&gt;<br>
<br>Generally, if you can, use a Python Script or something. The Iterator<br>is/was used in Plone templates to increment the tab index.<br><br><a href="mailto:tonylabarbara@aol.com">tonylabarbara@aol.com</a> wrote:<br>&gt; Hi;
<br>&gt; Iīm trying to increment a variable in a page template. Hereīs the<br>&gt; general idea in my code:<br>&gt;<br>&gt; &lt;div metal:define-macro=&quot;main&quot; tal:define=&quot;x python:0&quot;&gt;<br>&gt;<br>&gt; &lt;tal:block tal:define=&quot;x python:x + 1&quot;&gt;
<br>&gt; &lt;td&gt;<br>&gt; &lt;input type=&quot;hidden&quot; tal:attributes=&quot;value item/name; name<br>&gt; python:&#39;item_name_&#39; + `x`&quot;&gt;<br>&gt;<br>&gt;<br>&gt; Now, all of that works...once. That is, it increments from 0 to 1, but
<br>&gt; not from 1 to 2! Each time I pass through the td element, I need it to<br>&gt; increment. I tried putting the tal definition in the td, but then it<br>&gt; didnīt even increment once! What do?<br>&gt; TIA,<br>&gt; Tony
<br>&gt; ------------------------------------------------------------------------<br>&gt; AOL now offers free email to everyone. Find out more about what&#39;s free<br>&gt; from AOL at *AOL.com* &lt;<a href="http://www.aol.com?ncid=AOLAOF00020000000437">
http://www.aol.com?ncid=AOLAOF00020000000437</a>&gt;.<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________<br>&gt; Zope maillist&nbsp;&nbsp;-&nbsp;&nbsp;
<a href="mailto:Zope@zope.org">Zope@zope.org</a><br>&gt; <a href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope</a><br>&gt; **&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp;&nbsp;**<br>&gt; (Related lists -
<br>&gt;&nbsp;&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>&gt;&nbsp;&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-dev">http://mail.zope.org/mailman/listinfo/zope-dev
</a> )<br><br>--<br>Peter Bengtsson,<br>work <a href="http://www.fry-it.com">www.fry-it.com</a><br>home <a href="http://www.peterbe.com">www.peterbe.com</a><br>hobby <a href="http://www.issuetrackerproduct.com">www.issuetrackerproduct.com
</a><br>_______________________________________________<br>Zope maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Zope@zope.org">Zope@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope
</a><br>**&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp;&nbsp;**<br>(Related lists -<br> <a href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</a><br> <a href="http://mail.zope.org/mailman/listinfo/zope-dev">
http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br></blockquote></div><br>