fluidtypo3-8.xviewhelper

Typo3 Fluid: elseif inline notation


Is there an inline notation for the following example?

<f:if condition="{value}==1">
    <f:then>Value is 1</f:then>
    <f:else if="{value}==2">Value is 2</f:else>
</f:if>

Thanks for your help


Solution

  • probably it will be the cascading of if-viewhelpers:

    {f:if(condition:'{value}==1', 
        then:'Value is 1', 
        else:'{f:if(condition:\'{value}=2\', then:\'Value is 2\')}'
    )}
    

    with the usual drawback of escaping string-delimiter for stacked inline viewhelpers.