Tillebeck
Tillebeck

Reputation: 3523

TYPO3 fluid itemIteration.index > 10

I am tryind to add a class in fluid based on a condition after addind itenIteration to the each loop.

Here it is only the first that works. Number two comes out as text. So there must be something wrong in the formatting.

<tr class="item{f:if(condition: itemIteration.isFirst, then: 'hidden')}">
<tr class="item{f:if(condition: itemIteration.index > 10, then: 'hidden')}">

I can write it this way so index is working fine!

<tr class="<f:if condition="{itemIteration.index} > 10">hidden</f:if>">

Upvotes: 0

Views: 318

Answers (1)

Merec
Merec

Reputation: 2761

You forgot to quote the condition

<tr class="item{f:if(condition: itemIteration.index > 10, then: 'hidden')}">

must be

<tr class="item{f:if(condition: '{itemIteration.index} > 10', then: 'hidden')}">

Upvotes: 4

Related Questions