[ZPT] Re: tal:repeat and variables

Evan Simpson evan@4-am.com
Wed, 12 Feb 2003 10:13:36 -0600


Fernando Martins wrote:
> without resorting to (ugly) global variables, is there a way to pass values
> from one iteration of tal:repeat to another?

Nope.  However...

> Topic     |  Name
> --------------------
> Computers | John
>           | Smith
>           | Dilvert
> Software  | Peter
>           | Mary

...is doable.  Assuming that your repeat variable is 'record', and the 
first column is 'record/topic', try this:

<td><span tal:condition="python:repeat['record'].first('topic')"
      tal:content="record/topic">TNAME</span></td>

Cheers,

Evan @ 4-am