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

Answered Hide TV if empty

    • 27750
    • 3 Posts
    Hi Guys,

    Really struggling with this code, using new REVO. I have hunted through the forum and tried multiple bits of code but none of the solutions worked for me. I've tried all the following:

    [[!If? &subject=`[[*AssessmentLink]]` &operator=`notempty` &then=`<div class="assessment"><a href="[[*AssessmentLink]]" class="button radius [[getResources? &tpl=`@INLINE [[+colour]]` &resources=`[[+parent]]` &includeTVs=`1` &tvPrefix=`` ]] small assess">Take Assessment</a></div> `]]


    [[if? &is=`[*AssessmentLink]:isempty` &then=`` &else=`<div class="assessment"><a href="[[*AssessmentLink]]" class="button radius [[getResources? &tpl=`@INLINE [[+colour]]` &resources=`[[+parent]]` &includeTVs=`1` &tvPrefix=`` ]] small assess">Take Assessment</a></div> `]]


    Any help would be good


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

    [ed. note: smileyblonde1 last edited this post 9 years, 4 months ago.]
      • 51272
      • 7 Posts
      Have you tried with an output filter?
      Something like:

      [[*AssessmentLink:notempty=`
      <div class="assessment">
          <a href="[[*AssessmentLink]]" class="button radius [[getResources? &tpl=`@INLINE [[+colour]]` &resources=`[[+parent]]` &includeTVs=`1` &tvPrefix=``]] small assess">
              Take Assessment
          </a>
      </div>
      `]]
      


      That should do the trick smiley
        • 27750
        • 3 Posts
        Quote from: joekekloosterman at May 16, 2017, 06:06 AM
        Have you tried with an output filter?
        Something like:

        [[*AssessmentLink:notempty=`
        <div class="assessment">
            <a href="[[*AssessmentLink]]" class="button radius [[getResources? &tpl=`@INLINE [[+colour]]` &resources=`[[+parent]]` &includeTVs=`1` &tvPrefix=``]] small assess">
                Take Assessment
            </a>
        </div>
        `]]
        


        That should do the trick smiley

        Spooky i just tried this! It didn't work either sad If i whip off the MODx code before the div it displays, so I know that's right but if I put anything in front, it hides everything and nothing displays, not even the one TV that's populated for testing?
        • discuss.answer
          • 27750
          • 3 Posts
          Ok this worked, wee tweak of your code @Joeke smiley

          [[+AssessmentLink:notempty=`<div class="assessment"><a href="[[+AssessmentLink]]" class="button radius [[getResources? &tpl=`@INLINE [[+colour]]` &resources=`[[+parent]]` &includeTVs=`1` &tvPrefix=`` ]] small assess" target="blank">Take Assessment</a></div>`]]


          Thanks smiley [ed. note: smileyblonde1 last edited this post 9 years, 4 months ago.]