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 <<a href="mailto:peter@fry-it.com">
peter@fry-it.com</a>>:</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><div tal:define="iter python:modules['ZTUtils'].Iterator(range(1000))">
<br> <br tal:define="dummy iter/next" tal:replace="iter/number" /><br> <br tal:define="dummy iter/next" tal:replace="iter/number" /><br> <br tal:define="dummy iter/next" tal:replace="iter/number" />
<br></div><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> <br tal:repeat="i python:range(3)" tal:replace="i" /><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>> Hi;
<br>> Iīm trying to increment a variable in a page template. Hereīs the<br>> general idea in my code:<br>><br>> <div metal:define-macro="main" tal:define="x python:0"><br>><br>> <tal:block tal:define="x python:x + 1">
<br>> <td><br>> <input type="hidden" tal:attributes="value item/name; name<br>> python:'item_name_' + `x`"><br>><br>><br>> Now, all of that works...once. That is, it increments from 0 to 1, but
<br>> not from 1 to 2! Each time I pass through the td element, I need it to<br>> increment. I tried putting the tal definition in the td, but then it<br>> didnīt even increment once! What do?<br>> TIA,<br>> Tony
<br>> ------------------------------------------------------------------------<br>> AOL now offers free email to everyone. Find out more about what's free<br>> from AOL at *AOL.com* <<a href="http://www.aol.com?ncid=AOLAOF00020000000437">
http://www.aol.com?ncid=AOLAOF00020000000437</a>>.<br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________<br>> Zope maillist -
<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>> ** No cross posts or HTML encoding! **<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><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 - <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>** No cross posts or HTML encoding! **<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>