We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1800
    • 52 Posts
    I want to make a drop down menu tv that I can use to toggle on and off a chunk. The problem is if i use the code "On=={{chunk}}||Off== " and I select off it will default it to On since their is nothing there.

    I can add "On=={{chunk}}||Off==&nbsp" but then i get a &nbsp in my code...

    thoughts?
      Minneapolis Web Design <-- where i work
      MODx Templates <-- new project im working on
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You could use check boxes instead:
      Test=={{Testing}}

      works in that case.

      If you must have a drop-down menu, you could create a chunk that is empty, or just do this to provide an empty space to select "nothing":
      ||On=={{Testing}}
        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
        • 1800
        • 52 Posts
        Checkboxes dont work.. when i tried the checkbox example you had in the past it still defaulted. Having a blank check isnt best either since room is still left.
          Minneapolis Web Design <-- where i work
          MODx Templates <-- new project im working on
          • 10487 MODX Staff
          • 1,535 Posts
          The problem is if i use the code "On=={{chunk}}||Off== " and I select off it will default it to On since their is nothing there.
          You could set the ’Off’ status to use an non-existent placeholder - as all unparsed placeholders are removed from the page as part of the parsing process and it would avoid the checkbox defaulting to On.

          Something like:
          On=={{chunk}}||Off==[+intentionally_blank+]

          Just one idea of how to work around the problem ... wink
            Garry Nutting
            Senior Developer
            MODX, LLC

            Email: [email protected]
            Twitter: @garryn
            Web: modx.com