Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
About iw_iterator
System
Hi,
I have one question about templating file, I want to list all items and print br tag each of three items.
My code is as below:
<iw_iterate var="x" list="dcr.CatInto" iteration="current_number">
<iw_value name='x.CatName'/>
<iw_if expr='{$current_iteration_number%4 == 3 }'>
<iw_then>
<br>
</iw_then>
</iw_if>
</iw_iterate>
All looks good, but i find that the tag <iw_if> doesn't work, even if my code is changed to <iw_if expr='{$current_num == 0}'>,
the expr still regards the result as true....
I don't know what's wrong with this. could anyone tell me?
Thanks a lot!!!!!!!!!!!!!
Find more posts tagged with
Comments
Adam Stoller
Not sure if this is a posting typo - or an actual typo in your code - but ....
<iw_iterate var="x" list="dcr.CatInto" iteration="
current_number
">
<iw_value name='x.CatName'/>
<iw_if expr='{$
current_
iteration_
number
%4 == 3 }'>
<iw_then>
<br>
</iw_then>
</iw_if>
</iw_iterate>
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
I'm sorry, it's my posting typo....
and I can't tell the difference between
expr
and
expn
...
would be that the cause of the problem?
thanks a lot
Adam Stoller
I think expr is correct - but looking at the documentation I can think of a couple of alternative ideas to try:
<iw_if expr="{iw_value name='current_number'}%4 == 3">
<iw_if expr="$current_number%4 == 3">
See if either of those do what you want...
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
I had tried out both two ways before, and still it didn't work .
Last night something happened. I modified some code and run it, and suddenly it worked!
I don't know why. All I had done was restart interwoven last afternoon.
May the problem be caused by cache?
Anyway, thank you very much.