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

    I'm trying to hide the line
    <a href="[[+fileURL]]">Download</a>
    if fileURL is empty. Is this possible?

    Thanks

     [[!getImageList? 
     &tvname=`myTV`
     &tpl=`@CODE:
    <h2>[[+title]]></h2>
    <p>[[+text]]</p>
    <a href="[[+fileURL]]">Download</a>
    `]]
    

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

    [ed. note: wibble last edited this post 10 years, 1 month ago.]
      • 32507
      • 142 Posts
      Use IF extra

      https://rtfm.modx.com/extras/revo/if

      [[!If? &subject=`[[+fileURL]]` &operator=`notempty` &then=`<a href="[[+fileURL]]">Download</a>`]]
        • 28432
        • 372 Posts
        Or use output filter :

        [[+fileURL:notempty=`<a href="[[+fileURL]]">Download</a>`]]
          • 42262
          • 17 Posts
          Thanks for the suggestions guys. Unfortunately neither of them are outputting anything. Could it be because they are being used inside
          [[!getImageList?
          • discuss.answer
            • 52064
            • 120 Posts
            not use @CODE:, create a chunk.
              FerX - Developer at Eracom s.r.l.