jeudi 21 mars 2019

TYPO3 Fluid elseif with && condition

I'm trying to get this code working:

<f:if condition="{item.spacer} || {item.current}">
  <f:then>
    <li class="{f:if(condition:item.current, then:'nav-item active')}{f:if(condition:item.spacer, then:'nav-item spacer')}">
      <f:render partial="Navigation/Elements/Link" arguments="{item: item}"/>
  </f:then>
  <f:else if="{item.children} && {item.active}">
    <li class="nav-item dropdown active">
      <f:render partial="Navigation/Elements/Link" arguments="{item: item}"/>
  </f:else>
  <f:else if="{item.children}">
    <li class="{f:if(condition:item.children, then:'nav-item dropdown')}">
      <f:render partial="Navigation/Elements/Link" arguments="{item: item}"/>
  </f:else>
  <f:else if="{item.active}">
    <li class="{f:if(condition:item.active, then:'nav-item active')}">
      <f:render partial="Navigation/Elements/Link" arguments="{item: item}"/>
  </f:else>
  <f:else>
    <li class="nav-item">
      <f:render partial="Navigation/Elements/Link" arguments="{item: item}"/>
  </f:else>
</f:if>

The li-tag is closed afterwards in parent partial. The only thing not working ist the combined condition in the first else if. Altough item.children and item.active are true, the condition only consisting of item.active is rendered. What am I doing wrong here?

Thanks, Jonathan

Aucun commentaire:

Enregistrer un commentaire