We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14225
    • 12 Posts
    Is there a way for TV’s to be passed globally to all of my templates that use that TV?

    I have a chunk which includes the TV and is used in many of my templates. If I change the TV it will only update the pages that use that template - is there anyway to get all of the other templates to automatically update as well?

    I know I can change the chunk myself but some of the users aren’t at all technical and I don’t want them to access the chunk code in case they change the wrong thing!

    Many thanks.
      • 25519
      • 265 Posts
      If I understand you correctly, wouldn’t that be a case of setting the Default Value in the TV?
        • 14225
        • 12 Posts
        Thanks for your response.

        The TV’s value will be changed every couple of months so a default value won’t work for this unfortunately unless there is a way to use the default value to overwrite the current value (I have tested it and don’t think it does)?

          • 20413
          • 2,877 Posts
          One approach is using a simple chunk and these optional plugins:
          PHx
          http://modxcms.com/forums/index.php/topic,33316.msg238461.html#msg238461
          +
          UI Messages
          http://modxcms.com/forums/index.php/topic,37321.msg225741.html#msg225741

          PHx enables you all kinds of options. If the TV value is something show chunk, if
          chunk value is something show it or not.
          With the other plugin for UI Messages you could link the chunk if you want restrict
          hide tabs for clients etc.

          Or a binding. Like @FILE and @INHERIT
          http://modxcms.com/forums/index.php/topic,34566.0.html
            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • 4172
            • 5,888 Posts
            If I understand you correctly you want to have a value or text, which is the same on several places on your website. Ok, this is what chunks are normally for.
            But you want your editor/customer can edit these contents the same way as he can edit TV-contents.
            Why not creating one ressource ’site-settings’ or something like that.
            Let your user modify ’global TVs’ at this document and use for example the getField-snippet to get these ’global’-Values. you can put the getField-call in your chunks, which are placed in your templates or place getField-call directly in your templates.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 17883
              • 1,039 Posts
              Or create a root folder where you put in all your present root folders/documents. Insert @inherit as standard option for the TV. So you only have to change the TV of the new root folder, all child folders and documents inherit this value.
                • 14225
                • 12 Posts
                Wow, thanks all for you speedy responses - I’m sure I’ll b albe to get one these suggestions working smiley
                  • 29201
                  • 239 Posts
                  Quote from: MadeMyDay at Jan 04, 2010, 04:28 PM

                  Or create a root folder where you put in all your present root folders/documents. Insert @inherit as standard option for the TV. So you only have to change the TV of the new root folder, all child folders and documents inherit this value.

                  How do you get the children pages to show in the menu if you don’t want the folder you created to show?
                    • 3749
                    • 24,544 Posts
                    Quote from: jj0101 at Jan 04, 2010, 06:27 AM

                    Is there a way for TV’s to be passed globally to all of my templates that use that TV?

                    I have a chunk which includes the TV and is used in many of my templates. If I change the TV it will only update the pages that use that template - is there anyway to get all of the other templates to automatically update as well?

                    I know I can change the chunk myself but some of the users aren’t at all technical and I don’t want them to access the chunk code in case they change the wrong thing!

                    Many thanks.

                    Maybe I’m misunderstanding you, but it sounds to me like your problem can be solved just by connecting the TV to all your templates. A TV isn’t limited to just one template.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 29201
                      • 239 Posts
                      I found my solution and it is......[[getField]] this is the global template variable solution that i was looking for.