Zope ZPT Using global variables

Zope page template example using a global variable to store a counter.
<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>
Posted by
Snippet Viewed 1581 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.

 

Submit | Browse

Most Recent zope zpt snippets

Most Viewed