We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36723
    • 94 Posts
    Hello -
    Can i use a TV to turn on or off a ditto call in a template.

    For example I have a homepage and in the template I have a TV which if set to yes will then make a ditto call
    and show 3 stories on the homepage or if not set call another TV and show the contents of that tv.

    Any thoughts on how this could be done?

    I would like to put the ditto call in my else but that does not look right any suggestions?

    [+phx:if=`[*newsOveride*]`:is=`yes`:then=`
    <strong>News is overidden!</strong>
    `:else=`Showing Stories as Normal`+]
    


    Thanks,
    Bart
      • 3749
      • 24,544 Posts
      If I’m understanding you, it sounds like you want this:


      [+phx:if=`[*newsOveride*]`:is=`yes`:then=`
      [!Ditto ... !]`:else=`[*Other-TV*]`+]
      


      BTW, if you want to use a checkbox or radio buttons for the newsOveride TV, you’ll need to use

      :is=`1`
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 36723
        • 94 Posts
        Yes I did not realize you can put a Ditto statement in between the backticks ``. I thought you might have to concatenate it somehow.

        Thanks BobRay!
        Bart