Fluid allows to use the interactions in its templates. Below is a list of iterations Fluid:
itemIteration.index (0 based index of the iteration)
itemIteration.cycle (the same as index, but starting from 1)
itemIteration.total (total number of items)
itemIteration.isFirst (TRUE for the first item in the iteration)
itemIteration.isLast (TRUE for the last item in the iteration)
itemIteration.isOdd (TRUE for odd cycles 1,3,5,...)
itemIteration.isEven (TRUE for even cycles 2,4,6,…)
A good example is to create a list with a class for odd and even:
<ul>
<f:for each="{values}" as="value" iteration="iterator">
<li class="{f:if(condition:'{iterator.isOdd}',then:'odd',else:'even')}">{value}</li>
</f:for> </ul>
The result should be the following:
<ul>
<li class="odd">a</li>
<li class="even">b</li>
<li class="odd">c</li>
</ul>