We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33453
    • 141 Posts
    This may be obvious to the more experienced users but it may be useful to others.

    Currently I have a single template for my site, where the only things that change for each page are the [*content*] and the sidebar contents. I have the sidebar contents controlled by a TV for the template. Lately however, this TV is growing and now has about a dozen options. Not all options are applicable to any of the pages.

    The answer to this is to have a number of templates, one for each type of page, with their own TV of options. This would just involve replicating the current template a number of times. The problem with this is that any changes to the template would need to be applied to each of them.

    My simple idea is this:
    Have the entire HTML for the template as a chunk. I can then have as many templates as I need, all calling this chunk, and each with their own TV, yet I still only need to make changes in one place.
      • 32241
      • 1,495 Posts
      Instead of creatin multiple chunk for template, why don’t you duplicate and create multiple template for your site, with each template having its own desire TV. I think it will serve better with your purpose.

      Sincerely,
        Wendy Novianto
        [font=Verdana]PT DJAMOER Technology Media
        [font=Verdana]Xituz Media
      • This exactly where the new @INHERIT binding comes in. What you want is to customize the value of the TV for specific sections of the site, right? Why not edit the parent folder of each section to have it’s customized menu set properly, then all children of these folders would have the value @INHERIT, which would allow them to inherit the customized TV value of the parent (rather than showing the default, or having to be customized separately).
          • 6726
          • 7,075 Posts
          I think the @INHERIT binding will be a much useful one, way more efficient than replicating, not to mention less maintenance work and risk of error.

          A tutorial would be very helpful smiley
          Maybe once I wrap my head around this I’ll write one...
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 32847
            • 171 Posts
            @INHERIT is very usefull, I just looked at this and it’s exactly what I need for my TV.
            I didn’t understand what that for at the beginning tongue
            I discover each day a new nice tip in MODx
            Thanks
              • 6726
              • 7,075 Posts
              I know the feeling ! MODx has so much degrees of freedom that you need some time to really dig the scope of its potential...

              Other @bindings are powerful too, but sometimes hard to grasp...
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l'outil id