We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • How would I begin to go about setting up template variables such that some TVs only become available when other TVs have been set (or have been set to a certain value)?

    For instance, I’ve got TVs called "leftColumn" and "rightColumn". I’ve also got one called "contentLayout" that lets the user pick from various content layouts - some of which have a left and/or right column.

    I’d like to set this up such that "rightColumn" only shows up in the Manager form when the user has selected a contentLayout option that includes a right column.

    I don’t expect a full-blown tutorial, but some general direction on where to start digging would be a great start.
      • 28215
      • 4,149 Posts
      I think you’d have to do a custom TV type, and I don’t think we’ve ironed out that process yet. I’ll definitely post a tutorial when we get to that stage.

      Or just do separate Templates.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • Quote from: splittingred at Mar 24, 2010, 08:55 PM

        Or just do separate Templates.

        Can’t do it... I’m obsessed with using a single template for all pages that have the same basic layout. smiley

        Nothing I could do with plugins on this front?

        • Quote from: jrotering at Mar 24, 2010, 09:29 PM

          Quote from: splittingred at Mar 24, 2010, 08:55 PM

          Or just do separate Templates.

          Can’t do it... I’m obsessed with using a single template for all pages that have the same basic layout. smiley
          But that’s what templates are for; otherwise you are building a layout abstraction on top of a layout abstraction. You can still edit once by putting common markup in chunks and/or TV’s common to all templates as appropriate.
          • Quote from: OpenGeek at Mar 24, 2010, 10:41 PM

            But that’s what templates are for; otherwise you are building a layout abstraction on top of a layout abstraction.

            Thanks, Jason, for that cold bucket of water to the face. It was exactly what I needed. I knew I had become hell-bent on the One-Template concept to the point where it probably wasn’t serving me... but for some reason I couldn’t get past it. Explaining the nature of my error in a simple sentence like that helps me see it better.

            As I think more about it, it seems like what I am really after is something along the lines of a "Template Group"... where the individual templates could each just focus on some inner markup, and have the necessary TVs for that kind of document... and then they’d all be wrapped in the same outer HTML template and basic div structure, so they all got the same standard header/footer/css/etc. I realize I can do this by just reusing chunks in all each template... but for some reason the thought of having to repeat that same outer structure (even when it is abstracted into chunks) has just really been a hard thing to swallow. But I think I have a clearer picture now of how I might move forward.



              • 28215
              • 4,149 Posts
              Yep. Every site I make has a [[$pageHeader]] and [[$pageFooter]] chunk. smiley
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 34120
                • 236 Posts
                Quote from: jrotering at Mar 25, 2010, 02:22 PM

                I had become hell-bent on the One-Template concept
                I’m glad to have found this thread, I’ve been in the exact same mindset as this and struggling a little.