Neue Features von FLUID in Typo3 8 LTS (Typo3 8.7)

Mit FLUID kann man nun komplexe, verschachtelte und gruppierte  Abfragen durchführen, wie zum Beispiel:

<f:if condition="({variableOne} && {variableTwo}) || {variableThree} || {variableFour}">
// Done if both variable one and two evaluate to true,
// or if either variable three or four do.
</f:if>

Es gibt nun die Möglichkeit, bei IF-Abfragen auch elseif-Schleifen abzufragen:

<f:if condition="{variableOne}">
<f:then>Do this</f:then>
<f:else if="{variableTwo}">
Do this instead if variable two evals true
</f:else>
<f:else if="{variableThree}">
Or do this if variable three evals true
</f:else>
<f:else>
Or do this if nothing above is true
</f:else>
</f:if>

Neuer ViewHelper: f:or

Damit kann man verkettete Abfragen schnell durchführen – die erste Variable die nicht leer ist wird ausgegeben:

{variableOne -> f:or(alternative: variableTwo) -> f:or(alternative: variableThree)}

 

 

 

 

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert