Forum Discussion

JillianB's avatar
JillianB
Genius
11 years ago

How do I use two <#if> in a component?

I'm currently using an <#if> in my component to show one image if the corenodeID is a certain group and another image is anything else. I now need to complicate things and add in another <#if> to sho...
  • dementad's avatar
    11 years ago

    #elseif

     

    Or maybe I misunderstand your question.

  • VarunGrazitti's avatar
    11 years ago

    JillianB - Please try the code, I have made some changes to it and used elseif instead of your second if condition.

     

     

    <#if coreNode.id?? && ((coreNode.id == "Instructor") || (coreNode.id == "Income") || (coreNode.id == "BlockWorksIC") || (coreNode.id == "TTSVirtual") || (coreNode.id == "Skills") || (coreNode.id == "FTF") || (coreNode.id == "BestPractices") || (coreNode.id == "Resources"))> 

    <div class='VIC_community_logo'>
    <a href="/t5/Instructor-Community/ct-p/Instructor" class="VICcommunityLogo" title="Virtual Instructor Community">Virtual Instructor Community</a>
    <span class="tagline">Collaborating for success.</span>
    </div>
    <#elseif coreNode.id?? && ((coreNode.id == "BlockWorks") || (coreNode.id == "PersonalRet") || (coreNode.id == "Training") || (coreNode.id == "BusinessRet") || (coreNode.id == "BWResources"))>
    <div class='VIC_community_logo'>
    <a href="/t5/BlockWorks/ct-p/BlockWorks" class="BWcommunityLogo" title="BlockWorks District Advocate Community">Blockworks District Advocate Community</a>
    <span class="tagline">Collaborating for success.</span>
    </div>
    <#else>
    <div class='hrb_community_logo'>
    <a href="/" class="communityLogo" title="The Community">The Community</a>
    <span class="tagline">Looking at life through tax.</span>
    </div>
    </#if>

     

     

    Let me know if this helps. Also refer to this documentation here.