[TYPO3-mvc] Iterator + check modulo

Dawid Pacholczyk dpacholczyk at gmail.com
Wed Mar 23 15:37:28 CET 2011


Damn so obvious !!!!!!

Thanks Franz :) atm I feel so so so small :)

Best regards,
Dawid

W dniu 2011-03-23 15:29, Franz Koch pisze:
> Hey,
>
>> Are you sure there is no modulo ?
>
> no, not sure. Didn't have a look, but I thought it's not supported just
> like math operations.
>
>> I found this in comments
>>
>> * <f:if condition="{rank} % 2">
>> * Will be shown if rank % 2 != 0.
>> * </f:if>
>
> so why don't you use exactly this syntax? I suppose the reason why it's
> not working is that you in your snippet have two operands.
>
>>>> <f:if condition="{iterator.index} % 4 == 0">
>
> So you probably you have to use <f:then> and <f:else> to negate the
> condition.
>
> <f:if condition="{iterator.index} % 4">
> <f:then>--nothing--</f:then>
> <f:else>do something</f:else>
> </f:if>
>



More information about the TYPO3-project-typo3v4mvc mailing list