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

    I’m trying to create a template vairable that has three checkbox values.

    Newsletter
    News
    RelatedInfo

    I want the user to be able to check on each page which of the above appear on the page. I thought phx would be the best way to go, but i can seem to get it to recognise if more then checkbox is check.

    This work fine if just news is checked:
    [+phx:if=`[*rightelements*]`:is=`news`:then=`i’m news`+]

    But if new and relatedInfo is check then it doesn’t recognise either.

    Anyone mange to do somthing similar to this, is phx the best thing to be using here?

    Thanks

    Ben
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      One way to do this is to make three chunks, then in your TV have the chunk tags as the value attributes of the TV
      newsletter=={{newsletter}}||news=={{news}}||relatedinfo=={{relatedinfo}}

      whichever one the editor selects will be inserted.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 36926
        • 701 Posts
        Thanks sottwell, i think will do the trick for me. Nice one grin