We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28825
    • 61 Posts
    I am having a little trouble and I’ve tried a few things to no avail.

    I created a site template that has two columns (A center column and a right column). The right column stays empty but on certain pages I want to insert content into that column. Is there any way I can access the other "DIVS" in my main template on a page specific basis? (Meaning I do not want to enter that content onto EVERY page via the template but I want to be able to access the right column div through the content editor)

    As I understand it, when I create a new document in ModX, it is going to plug in all the stuff I insert into the edit window into where I put the [*content*] tag in my main template. But is there any way I can access the rightcolumn div through editing or creating a new document?

    Is the answer with a TV or is there a way I can "activate a hidden chunk" I set up on my template based on the page I am on? huh

    Any thoughts on this question would appreciated.
      "Don't waste your time or time will waste you"
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The answer is TVs. These are very powerful, study the docs and samples.

      I use a TV for my sidebar:
      <div id="sidebar">[*sidebar*]</div>

      The sidebar TV is set to be textarea, and the default value is @INHERIT.
      Then for each section’s parent document, I can put whatever I want to be in the sidebar for that section, and the child pages will inherit it. Plus I can edit it for any specific pages I want something special for.

        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
        • 28825
        • 61 Posts
        Thanks for the reply sottwell!
        I knew the answer had to do with TV’s...I read the docs and I am going to try to @CHUNK binding to see if this works. I will post my results/questions.

        UPDATE: I created a TV called [*newsletter*] and it was an @CHUNK binding to a chunk called newsletter that had the sign up form code. In my template, in the rightcolumn DIV, I put [*newsletter*]. But that just created that chunk in every single page as if I had just put the actual chunk into the template.

        My question is: After creating a TV and binding it and putting it where you want it to be in the main template, how can you "Selectively" call it into the current document while leaving it out of others? Am I using the wrong binding or am I placing the TV in the wrong place?

        UPDATE #2: Just read the tutorial on TV based Chunks and it did the trick.
          "Don&#39;t waste your time or time will waste you"
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Leave it empty, and put the @CHUNK in the TV editing field for the pages where you want it.

          What you put in the "default" field when you create the TV will be the default value for all pages using the template.
            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