We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39583
    • 103 Posts
    Hello guys,
    I would like to show a link that I store in a TV if its not empty. I've tried the following code which doesn't work. It always gets the "getLinkImage" chunk no matter if the TV is empty or not. (Now when I'm writing this I realize that this is the correct behaviour since I think it checks if the resource is empty, which its not.)

    [[!getResources:default=`[[$getNothing]]`? 
    &resources=`[[*id]]` 
    &tpl=`getLinkImage` 
    &showHidden=`1` 
    &limit=`5` 
    &depth=`1` 
    &includeTVs=`1` 
    &processTVs=`1`]]


    But how can I display a two different chunks depending on if a tv is empty or not?

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

    [ed. note: phacer last edited this post 14 years, 1 month ago.]
      --
      André
    • discuss.answer
      • 39583
      • 103 Posts
      By putting an if statement with the if addon inside the chunk I got it to work.

      [[!If?
         &subject=`[[+tv.myTV]]`
         &operator=`EQ`
         &operand=``
         &then=``
         &else=`<a href="[[+tv.myTV]]"><img src="img/image.jpg" /></a>`
      ]]
        --
        André