[ZPT] Placeholder question

Evan Simpson evan@zope.com
Tue, 20 Nov 2001 10:03:59 -0500


Scott Burton wrote:

> I  figured I could do the math with <span tal:define="total python:total 
> + 1"></span> within the repeat tag. So it looks to me as if the 
> placeholder issue is what is holding me back.

You can do this, but only with global variables:

<tal:block define="global tot python:0" repeat="item items">
   <tal:block define="global tot python:tot + item.foo" />
</tal:block>

<span tal:replace="tot">The foo total</span>


If your logic is any more complicated than this, you should use a Script.

Cheers,

Evan @ Zope