We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14779
    • 256 Posts
    I have a question regarding TV’s. First off, let me say, that for the longest time I did not understand TV’s AT ALL. Then, when I did get it THE LIGHT CAME ON! WOW! TV’S are COOL!

    Anyway, my problem.

    I have a site that has a very basic sidebar. On a few pages I need to kill the sidebar, but I would like to use the same template for all the pages.
    SO, I set up a TV named [*sidebar*]. I also created a chunk {{sidebartext}} that contains the sidebar code from the template. (which i replaced with [*sidebar*] )

    I set up the TV like this:

    input type: radio buttons
    input option values: Include=={{sidebartext}}||Exclude==
    default value: {{sidebartext}}

    It works great! except....

    When i select ’Exclude’ on a document, the sidebar is gone, (perfect) but I get the word ’Exclude’ on my page.

    Here are some links to examples:

    Sidebar:
    http://throughmylensphotography.com/albums.html

    No Sidebar:
    http://throughmylensphotography.com/albums/floral_album_cart.html
      PM me to find out how you can get a FREE ipad 2!
    • Make a chunk called {{blank}} with even less content. wink
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 6726
        • 7,075 Posts
        To help the light come on again for you, if you define an empty value for your TV, it’s only normal that it does not output anything (basically, it does what you’re telling it to wink )

        It seems you acted as if your TV should have fell back to the default value despite assigning a blank value, am I wrong ? One thing to remember is, if you don’t assign a value to a TV, it will assign the default value, but if you assign a blank one, then you’ll only get that... blank tongue
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 14779
          • 256 Posts
          One thing to remember is, if you don’t assign a value to a TV, it will assign the default value, but if you assign a blank one, then you’ll only get that... blank

          That’s the little bit I overlooked!

          Thanks both of you!
            PM me to find out how you can get a FREE ipad 2!
            • 8216
            • 15 Posts
            The best solution would simply have the TV as a check box and just have Include=={{sidebartext}}

            The radio box would be used for multiple values (though I reckon a drop down list menu would be bestest).

            You could also have @inherit as the default value so that children will inherit the properties of their parents - useful for making these types of settings across sections. Be warned though, if you do this you can’t turn off the TV if the parent document has it set.
              modx ist rad