Check if row of array is odd

38 views
Skip to first unread message

saber...@gmail.com

unread,
May 12, 2015, 3:49:33 PM5/12/15
to rai...@googlegroups.com
I'll show you what I want to do :

{loop="cats"}
{if="is_odd($key)"}color1
{else}color2{/if}
{/
loop}

Is there a way to do that properly with raintpl ?

Federico Ulfo

unread,
May 12, 2015, 3:52:49 PM5/12/15
to raintpl
{loop="cats"}
    {if="$key % 2 == 0"}color1{/if}
    {else}color2{/if}
{/loop}

--
--
www.RainTPL.com
group at http://groups.google.com/group/raintpl
unsuscribe at raintpl+u...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "raintpl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raintpl+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages