On Thu, Sep 04, 2008 at 10:54:29AM +0200, Rafa?? Mi??ecki wrote:

> I wish to add some text after third (and later after every third)
> element in my list.
> 
> <tal:block tal:repeat="item lista">
>     <p tal:content="item/content">Place for content</p>
>     <div tal:condition="php: repeat/item/number==3">--BREAK--</div>
> </tal:block>
> 
> <tal:block tal:repeat="item lista">
>     <p tal:content="item/content">Place for content</p>
>     <div tal:condition="php: repeat/item/number%3==0">--BREAK--</div>
> </tal:block>
> 
> But it causes error "Unable to find path number in current scope". Is
> this possible to make such a condition?
> 
> I know I could generate in PHP something like item/isThird but I wish
> to keep my PHP code clean from such hacks.

you try to divide the numbers (/ is interpreted by php). use dots
instead. 
number, key, ... might even be functions thus adding () at the might be
needed (i am not sure, if this still the case with phptal).

-- 
cu

Attachment: pgpsS2dMkY4Sw.pgp
Description: PGP signature

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to