We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25483
    • 741 Posts
    Is it possible to make a statement like the below one in PHx? What I want to do is show a chunk when at least 1 of the tv’s has a value, the chunk has to be shown 1 time even if multiple tv’s have a value.

    if [*tv1*] or [*tv2*] or [*tv3*] has a value, then show {{chunk}}
      with regards,

      Ronald Lokers
      'Front-end developer' @ h2o Media

      • 3707
      • 241 Posts
      You could do it with AND statement:
      [+phx:if=`[*tv1*]`:is=``:and:if=`[*tv2*]`:is=``:and:if=`[*tv3*]`:is=``:then=``:else=`{{chunk}}`+]

      If all three TV’s are empty return nothing, else return the chunk.
        • 25483
        • 741 Posts
        That should do the trick, on irc eerne told me a even shorter trick:

        [+phx:if=`[*tv1*][*tv2*][*tv3*]`:ne=``:then=`{{chunk}}`+]


        I already did test this code and it works great laugh
          with regards,

          Ronald Lokers
          'Front-end developer' @ h2o Media