[TYPO3-mvc] Iterator + check modulo

Dawid Pacholczyk dpacholczyk at gmail.com
Wed Mar 23 15:02:53 CET 2011


Are you sure there is no modulo ?

I found this in comments

  * <f:if condition="{rank} % 2">
  *   Will be shown if rank % 2 != 0.
  * </f:if>

Best regards,
Dawid Pacholczyk

W dniu 2011-03-23 14:55, Franz Koch pisze:
> Hey,
>
>> I`m tring to display something after checking the iterator. So I have
>>
>> <f:for each="{categories}" as="cat" iteration="iterator">
>> <f:if condition="{iterator.index} % 4 == 0">
>> display me
>> </f:if>
>> </f:for>
>>
>> but it doesn`t work. What am I missing ?
>
> AFAIK the Fluid parser doesn't support mathematical operations and also
> not modulo etc. You either have to use a mathematical viewHelper with
> inline syntax here or use the cycle viewHelper:
>
> <f:for each="{...}" as="...">
> <f:cycle values="{0:'', 1:'', 2:'', 3:1}" as="isLast">
> <f:if condition="{isLast} == 1">...</f:if>
> </f:cycle>
> </f:for>
>



More information about the TYPO3-project-typo3v4mvc mailing list