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

    Just wondering what would be the best way of achieving the following:

    Have the right hand column change content depending on the page the user is on. So, for home, in the right column have 3 images, on the contact page, have the postal address, on the portfolio page have a case study in the right column etc. etc.

    Hope somebody can help, I am wondering if TV’s would be the way, just not 100% sure how to get about implementing this.

    Thanks
    Lee
      http://www.blend.uk.com | Web Design by Blend
    • Make your column’s content a TV, perhaps named "rightColumn". Then for each document you can edit it, just as you do its "content".
        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
        • 17717
        • 433 Posts
        Went into the new TV dialog box and I am confused. Exactly where would I add the 3 different types of content for the right column and how do I call this content from a particular page? Would I need to create a separate TV for each column.

        Sorry for the dumb question, started using modxcms properly last night and just getting to grips with it at the minute.

        Thanks
        Lee
          http://www.blend.uk.com | Web Design by Blend
        • When you create the TV, just use the "default content" and put whatever you want as "default", or even leave it blank. Make its Input type be "textarea", or "rich text" if you favor that. Give it a name, and if you like a description. Ignore everything else. Make sure to check the template at the bottom so documents using the template will have the TV.

          Now, every document using that template will have another field below its "Document content" field. Initially it will contain whatever you put in the TV’s "default content" field. There are any number of things you can do with it, but at its simplest just put the HTML code and text you want to use, or chunks and snippets. Exactly as you would the main "Document content" field. Except it can’t do another TV; if you want it to contain another TV you have to put the inner TV in a chunk.
            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
            • 17717
            • 433 Posts
            Thanks for your help, that works great. I understand the concepts around modx now too, much simpler than most cms out there that I have used.

            Thanks
            Lee
              http://www.blend.uk.com | Web Design by Blend
            • I think that very simplicity is what confuses so many new users. I like it because the code behind it is mostly pretty clean and simple as well, and I can play with it! grin
                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
                • 27226
                • 186 Posts
                Yes, that’s one of the main secrets of MODx, no doubt!
                Another secret is: how does the parser work?, I mean in which sequence are all the template- chunk- snippet- elements resolved? Since some nesting can happen here, I would very much like to see an outline of the whole procedure.
                  • 7923
                  • 4,213 Posts
                  Quote from: silent at Aug 05, 2006, 04:28 PM

                  Another secret is: how does the parser work?, I mean in which sequence are all the template- chunk- snippet- elements resolved?
                  Here’s a post from Wendy explaining the parsing order. I hope it helps!


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 27226
                    • 186 Posts
                    Yes, thanks! It just gave me some rough - and needed - ideas on how all those different types of elements (TV, Chunk, Snippet) work together, what’s possible and what’s not.
                    However, it is not a complete documentation on the parser’s procedures and built-in priorities though.
                    But since a configurable, 100%-recursive implementation is underway I understand why no one likes to to document stuff which is likely to become deprecated.
                    tongue