XF 2.2 xf:if xf:elseif xf:else - Template conditions

stromb0li

Well-known member
Hey XenForo,

Does XF templating support switch cases? For example, I have the following, is there a way to clean this up?

Code:
<xf:if is="$parentcase == 1">
    <xf:if is="$case == 1">
        Case 1
    <xf:elseif is="$case == 2"/>
        Case 2
    <xf:else/>
        Default case
    </xf:if>
<xf:elseif is="$parentcase == 2"/>
    Parent Case 2
<xf:else/>
    Parent Default Case
<xf:if/>
 
Last edited:
Back
Top Bottom