TYPO3 Fluid elseif with && conditionStyling multi-line conditions in 'if' statements?Python's equivalent of && (logical-and) in an if-statement“elseif” syntax in JavaScriptTYPO3 Fluid complex if conditionsconditions in extbase / fluid TYPO3TYPO3 fluid get @attributesFluid: if - then - elseif - elseTYPO3 inline fluid condition and typoscriptObjectPathTypo3 nested arrays in FluidTYPO3 Fluid dynamic variable part in inline if condition

Is it unprofessional to ask if a job posting on GlassDoor is real?

NMaximize is not converging to a solution

Why does Kotter return in Welcome Back Kotter?

How old can references or sources in a thesis be?

What does "Puller Prush Person" mean?

Fully-Firstable Anagram Sets

Are astronomers waiting to see something in an image from a gravitational lens that they've already seen in an adjacent image?

Why is 150k or 200k jobs considered good when there's 300k+ births a month?

Why are electrically insulating heatsinks so rare? Is it just cost?

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

Could an aircraft fly or hover using only jets of compressed air?

Alternative to sending password over mail?

Languages that we cannot (dis)prove to be Context-Free

How much RAM could one put in a typical 80386 setup?

Has there ever been an airliner design involving reducing generator load by installing solar panels?

What does the "remote control" for a QF-4 look like?

Can a vampire attack twice with their claws using Multiattack?

Replacing matching entries in one column of a file by another column from a different file

What would happen to a modern skyscraper if it rains micro blackholes?

Java Casting: Java 11 throws LambdaConversionException while 1.8 does not

Intersection point of 2 lines defined by 2 points each

Add text to same line using sed

What's the output of a record needle playing an out-of-speed record

How is it possible to have an ability score that is less than 3?



TYPO3 Fluid elseif with && condition


Styling multi-line conditions in 'if' statements?Python's equivalent of && (logical-and) in an if-statement“elseif” syntax in JavaScriptTYPO3 Fluid complex if conditionsconditions in extbase / fluid TYPO3TYPO3 fluid get @attributesFluid: if - then - elseif - elseTYPO3 inline fluid condition and typoscriptObjectPathTypo3 nested arrays in FluidTYPO3 Fluid dynamic variable part in inline if condition






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















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










share|improve this question






















  • What does <f:debug>item.children</f:debug> tell you? And, although it doesn't address your issue, you could omit many of the if-statements here, such as: <f:else if="item.active"> <li class="nav-item active">

    – phvt
    Mar 21 at 23:01












  • The output of <f:debug> is an array with the subpages of the page. I know that some if-statements are unnessesary, i had some more in it and didn't delete it.

    – Jonathan
    Mar 21 at 23:21












  • I tested this on my environment without errors. Can you improve your else if conditions to "item.children && !item.active" and "!item.children && item.active"? This is a bit more safe as actually both "item.children && item.active" and "item.children" are true in your case. So the order matters. Maybe that solves?

    – Mikel Wohlschlegel
    Mar 22 at 10:00











  • It doesn't work for me. I also tried putting it at the end now, but it makes no difference.

    – Jonathan
    Mar 22 at 11:02











  • When I put item.children && item.active in the first if condition, it works.

    – Jonathan
    Mar 22 at 11:09

















0















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










share|improve this question






















  • What does <f:debug>item.children</f:debug> tell you? And, although it doesn't address your issue, you could omit many of the if-statements here, such as: <f:else if="item.active"> <li class="nav-item active">

    – phvt
    Mar 21 at 23:01












  • The output of <f:debug> is an array with the subpages of the page. I know that some if-statements are unnessesary, i had some more in it and didn't delete it.

    – Jonathan
    Mar 21 at 23:21












  • I tested this on my environment without errors. Can you improve your else if conditions to "item.children && !item.active" and "!item.children && item.active"? This is a bit more safe as actually both "item.children && item.active" and "item.children" are true in your case. So the order matters. Maybe that solves?

    – Mikel Wohlschlegel
    Mar 22 at 10:00











  • It doesn't work for me. I also tried putting it at the end now, but it makes no difference.

    – Jonathan
    Mar 22 at 11:02











  • When I put item.children && item.active in the first if condition, it works.

    – Jonathan
    Mar 22 at 11:09













0












0








0








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










share|improve this question














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







if-statement typo3 fluid






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 21 at 22:48









JonathanJonathan

112




112












  • What does <f:debug>item.children</f:debug> tell you? And, although it doesn't address your issue, you could omit many of the if-statements here, such as: <f:else if="item.active"> <li class="nav-item active">

    – phvt
    Mar 21 at 23:01












  • The output of <f:debug> is an array with the subpages of the page. I know that some if-statements are unnessesary, i had some more in it and didn't delete it.

    – Jonathan
    Mar 21 at 23:21












  • I tested this on my environment without errors. Can you improve your else if conditions to "item.children && !item.active" and "!item.children && item.active"? This is a bit more safe as actually both "item.children && item.active" and "item.children" are true in your case. So the order matters. Maybe that solves?

    – Mikel Wohlschlegel
    Mar 22 at 10:00











  • It doesn't work for me. I also tried putting it at the end now, but it makes no difference.

    – Jonathan
    Mar 22 at 11:02











  • When I put item.children && item.active in the first if condition, it works.

    – Jonathan
    Mar 22 at 11:09

















  • What does <f:debug>item.children</f:debug> tell you? And, although it doesn't address your issue, you could omit many of the if-statements here, such as: <f:else if="item.active"> <li class="nav-item active">

    – phvt
    Mar 21 at 23:01












  • The output of <f:debug> is an array with the subpages of the page. I know that some if-statements are unnessesary, i had some more in it and didn't delete it.

    – Jonathan
    Mar 21 at 23:21












  • I tested this on my environment without errors. Can you improve your else if conditions to "item.children && !item.active" and "!item.children && item.active"? This is a bit more safe as actually both "item.children && item.active" and "item.children" are true in your case. So the order matters. Maybe that solves?

    – Mikel Wohlschlegel
    Mar 22 at 10:00











  • It doesn't work for me. I also tried putting it at the end now, but it makes no difference.

    – Jonathan
    Mar 22 at 11:02











  • When I put item.children && item.active in the first if condition, it works.

    – Jonathan
    Mar 22 at 11:09
















What does <f:debug>item.children</f:debug> tell you? And, although it doesn't address your issue, you could omit many of the if-statements here, such as: <f:else if="item.active"> <li class="nav-item active">

– phvt
Mar 21 at 23:01






What does <f:debug>item.children</f:debug> tell you? And, although it doesn't address your issue, you could omit many of the if-statements here, such as: <f:else if="item.active"> <li class="nav-item active">

– phvt
Mar 21 at 23:01














The output of <f:debug> is an array with the subpages of the page. I know that some if-statements are unnessesary, i had some more in it and didn't delete it.

– Jonathan
Mar 21 at 23:21






The output of <f:debug> is an array with the subpages of the page. I know that some if-statements are unnessesary, i had some more in it and didn't delete it.

– Jonathan
Mar 21 at 23:21














I tested this on my environment without errors. Can you improve your else if conditions to "item.children && !item.active" and "!item.children && item.active"? This is a bit more safe as actually both "item.children && item.active" and "item.children" are true in your case. So the order matters. Maybe that solves?

– Mikel Wohlschlegel
Mar 22 at 10:00





I tested this on my environment without errors. Can you improve your else if conditions to "item.children && !item.active" and "!item.children && item.active"? This is a bit more safe as actually both "item.children && item.active" and "item.children" are true in your case. So the order matters. Maybe that solves?

– Mikel Wohlschlegel
Mar 22 at 10:00













It doesn't work for me. I also tried putting it at the end now, but it makes no difference.

– Jonathan
Mar 22 at 11:02





It doesn't work for me. I also tried putting it at the end now, but it makes no difference.

– Jonathan
Mar 22 at 11:02













When I put item.children && item.active in the first if condition, it works.

– Jonathan
Mar 22 at 11:09





When I put item.children && item.active in the first if condition, it works.

– Jonathan
Mar 22 at 11:09












1 Answer
1






active

oldest

votes


















1














Active MenuItems have current=1 and active=1. In the first If-condition, current is checked and if =1, the following 'then' gets executed. After this, none of the others is checked and because of that, it didn't work. As I don't need item.spacer || item.current, this code works for me:



<f:if condition="item.children && item.active">
<f:then>
<li class="nav-item dropdown active">
<f:render partial="Navigation/Elements/Link" arguments="item: item"/>
</f:then>
<f:else if="item.children">
<li class="nav-item dropdown">
<f:render partial="Navigation/Elements/Link" arguments="item: item"/>
</f:else>
<f:else if="item.active">
<li class="nav-item active">
<f:render partial="Navigation/Elements/Link" arguments="item: item"/>
</f:else>
<f:else if="item.spacer">
<li class="nav-item spacer">
<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>





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290380%2ftypo3-fluid-elseif-with-condition%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Active MenuItems have current=1 and active=1. In the first If-condition, current is checked and if =1, the following 'then' gets executed. After this, none of the others is checked and because of that, it didn't work. As I don't need item.spacer || item.current, this code works for me:



    <f:if condition="item.children && item.active">
    <f:then>
    <li class="nav-item dropdown active">
    <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
    </f:then>
    <f:else if="item.children">
    <li class="nav-item dropdown">
    <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
    </f:else>
    <f:else if="item.active">
    <li class="nav-item active">
    <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
    </f:else>
    <f:else if="item.spacer">
    <li class="nav-item spacer">
    <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>





    share|improve this answer



























      1














      Active MenuItems have current=1 and active=1. In the first If-condition, current is checked and if =1, the following 'then' gets executed. After this, none of the others is checked and because of that, it didn't work. As I don't need item.spacer || item.current, this code works for me:



      <f:if condition="item.children && item.active">
      <f:then>
      <li class="nav-item dropdown active">
      <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
      </f:then>
      <f:else if="item.children">
      <li class="nav-item dropdown">
      <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
      </f:else>
      <f:else if="item.active">
      <li class="nav-item active">
      <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
      </f:else>
      <f:else if="item.spacer">
      <li class="nav-item spacer">
      <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>





      share|improve this answer

























        1












        1








        1







        Active MenuItems have current=1 and active=1. In the first If-condition, current is checked and if =1, the following 'then' gets executed. After this, none of the others is checked and because of that, it didn't work. As I don't need item.spacer || item.current, this code works for me:



        <f:if condition="item.children && item.active">
        <f:then>
        <li class="nav-item dropdown active">
        <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
        </f:then>
        <f:else if="item.children">
        <li class="nav-item dropdown">
        <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
        </f:else>
        <f:else if="item.active">
        <li class="nav-item active">
        <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
        </f:else>
        <f:else if="item.spacer">
        <li class="nav-item spacer">
        <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>





        share|improve this answer













        Active MenuItems have current=1 and active=1. In the first If-condition, current is checked and if =1, the following 'then' gets executed. After this, none of the others is checked and because of that, it didn't work. As I don't need item.spacer || item.current, this code works for me:



        <f:if condition="item.children && item.active">
        <f:then>
        <li class="nav-item dropdown active">
        <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
        </f:then>
        <f:else if="item.children">
        <li class="nav-item dropdown">
        <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
        </f:else>
        <f:else if="item.active">
        <li class="nav-item active">
        <f:render partial="Navigation/Elements/Link" arguments="item: item"/>
        </f:else>
        <f:else if="item.spacer">
        <li class="nav-item spacer">
        <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>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 22 at 11:23









        JonathanJonathan

        112




        112





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290380%2ftypo3-fluid-elseif-with-condition%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript