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)
modulus operator
getnaren
Hi ,
is there any exmple to use modulus operator for <iw_iterate list ??
I want to iterate and put them in 2 columns checking the count odd or even
Find more posts tagged with
Comments
jbonifaci
For future reference, this post probably should have been made in the TeamSite FormsPublisher (Templating) Forum.
As to your question, there are examples in the iwov help (
http://<serverName>/iw/help/tst/pt/TeamSite__PT__iw_iterate.html)
.
Here is an example straight from the help that does something every 10th iteration:
<iw_iterate var ='current_color'
list ='(
@colors)
'
iteration='color_count'>
<iw_iterate var ='current_shape'
list ='(
@shapes)
'
iteration='shape_count'>
<iw_if expr='!(({iw_value name="$color_count"/} +
{iw_value name="$shape_count"/})%10)'>
<iw_then>
do some special magic every
0th, 10th 20th (..etc) time around the loop!
</iw_then>
</iw_if>
here's a color: <iw_value name='current_color'/>
here's a shape: <iw_value name='current_shape'/>
</iw_iterate>
</iw_iterate>
You should be able to figure it out from there.
~Jeff