<ul tal:define="global displayedCount python: 0;"> <tal:loop repeat="feature features"> <li> <tal:update define="global displayedCount python: displayedCount + 1;" content="displayedCount" /> </li> </tal:loop> </ul>
Zope ZPT Using global variables
Zope page template example using a global variable to store a counter.
Snippet Viewed 1755 times.
Share your Zope ZPT code snippets:
- Get some recognition & a link back to your site.
- Create your own code library.
- Help your fellow developers, as they have helped you.