We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40638
    • 12 Posts
    Hello,

    I have 2 TVs in a template but I need one to be hidden if another one is active.
    I figured I could use the IF add-on (If 1.1.0-pl) but haven't quite worked it out.

    I have one template that happens across all pages then a second template for a specific resource.

    The [[*right-hand-content]] is managed on the specific resource and the [[getResourceField? &id=`280` &field=`accounts-rh-img` &processTV=`1`]] is the "master tv" that's on all pages by default.

    I have the IF call as below.

    [[!If?
       &subject=`[[*right-hand-content]]`
       &operator=`EQ`
       &operand=`1`
       &then=`Something to go here to hide this -->[[getResourceField?  &id=`280` &field=`accounts-rh-img` &processTV=`1`]]`
       &else=`[[getResourceField?  &id=`280` &field=`accounts-rh-img` &processTV=`1`]]`
    ]]


    So what should happen is if the manager adds content to this specific resources using [[*right-hand-content]] the other content should be hidden.

    I am thinking that the "&then" line is the one to tell it to hide the tvs but not sure on this, any help would be fanatsic.

    Cheers

    This question has been answered by ptron12. See the first response.

    [ed. note: ptron12 last edited this post 12 years, 11 months ago.]
    • discuss.answer
      • 40638
      • 12 Posts
      Actually I have worked this out already.

      For those that are curios this is how it works.

      [[If?
         &subject=`[[*right-hand-content]]`
         &operator=`isempty`
         &operand=``
         &then=`[[getResourceField?  &id=`280` &field=`accounts-rh-img` &processTV=`1`]]`
         &else=`[[*right-hand-content]]`
      ]]