We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53294
    • 5 Posts
    Good evening guys, help me solve this problem. I know that when creating a VT, it appears in a resource tab, right? However, by inserting any text, it will only appear in that resource. I'd like it to automatically go into all the resources I created. Or that it was global. When I enter, for example, in the home resource, it is not inserted, for example in the resource over us. Have to do all the work of inserting in on us.
      • 3749
      • 24,544 Posts
      When you create a TV (or edit it in on the Elements tab), you can set a default value for the TV. You can also make that value inherited by using this as the default value:

      @INHERIT somevalue

        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
        • 53457
        • 5 Posts
        Quote from: BobRay at May 13, 2017, 05:35 AM
        When you create a TV (or edit it in on the Elements tab), you can set a default value for the TV. You can also make that value inherited by using this as the default value:

        @INHERIT somevalue


        Thank you for your attention, as I am new to Modx, I would be grateful if you would exemplify it. For example, I want the content that I insert into the Variable Templates tab of a resource, there was no need to type it again in the tab of another resource.
          • 3749
          • 24,544 Posts
          I think you mean Template Variables rather then Variable Templates (no such thing). wink

          If the default value of the TV is @INHERIT, when you enter a value in the TV, that Value will be inherited by all that resource's children (assuming that they don't already have a value set for the TV).

          If you want the value to be available in *all* other resources, not just the Children, you don't want a TV. TV values are intended to be for specific resources.

          Instead, you probably want a create a new System Setting. When the System Setting has a value, that value will be available all over the site with a tag like this:

          [[++setting_name]]


          If you need an easy way to set the System Setting, try Mark Hamstra's excellent ClientConfig extra.
            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
            • 53457
            • 5 Posts
            Thank you very much for the answers.
              • 38850
              • 110 Posts
              I also use settings for site-wide variables.

              Create a new namespace and then just start filling it up with any custom data you need to reference.

              For multiple languages, you'd have to get a little fancier with lexicons and what not.