We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35408
    • 4 Posts
    Hi ModX community,
    something that has always plagued me with ModX based sites and never been able to figure out best way to handle:
    Scenario -> in the footer (chunk) of site, there is certain information which is global to the site: phone number, address, etc . . .. It would be nice to give the end user of the /manager section the ability to control this information without having to edit the chunk’s html. Similar to template variables but on a global level.

    I am sure this has come up and probably been addressed. Any thoughts or advice on how to best handle?
    thanks in advance.
      • 17499 ☆ A M B ☆
      • 872 Posts
      Not at this time.
      But it has been requested several time on the forum and it’s on the roadmap.
        • 19369
        • 1,098 Posts
        GetField Snippet is very similar to a Global TV.
        http://modx.com/extras/package/getfield -> GetField for Evolution
        http://modxcms.com/forums/index.php?topic=48794.0 -> GetField for Revolution
          • 5340
          • 1,624 Posts
          I do this by implementing those chunks on the home page.
          Alternatively you can create a tab named Site Settings on the home page
            • 35408
            • 4 Posts
            Thank you all, getResourceField worked like a champ.
              • 3109 ☆ A M B ☆
              • 894 Posts
              What I do is I use getResourceField and create a settings page for each site I am hosting and on this page I have a custom form field where I input the id of the settings page for the specific site along with all of the values pertaining to the site, contact info, address, phones numbers etc.

              Then I just pull those values throughout my templates it works like a charm.
                Benjamin Marte
                Interactive Media Developer
                Follow Me on Twitter | Visit my site | Learn MODX
                • 3749
                • 24,544 Posts
                Quote from: benmarte at May 17, 2011, 10:22 PM

                What I do is I use getResourceField and create a settings page for each site I am hosting and on this page I have a custom form field where I input the id of the settings page for the specific site along with all of the values pertaining to the site, contact info, address, phones numbers etc.

                Then I just pull those values throughout my templates it works like a charm.

                Can you clarify that a little? Are they TVs on the settings page, or are they System Settings? And how do you "pull them in"?
                  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
                  • 33968
                  • 863 Posts
                  I guess it would be possible in Revo to create a custom manager page for this purpose, providing a way for the user to edit ’global’ values/settings without needing access to the main ’System Settings’ section. Those global values (contact info, promo banners, etc) would be stored as standard system settings rather than using TVs.

                  Haven’t tried a CMP yet, might have a go at it smiley
                    • 17499 ☆ A M B ☆
                    • 872 Posts
                    But the point of those global vars would be to be editable from a resource edit page, not from a CMP.

                    Like Wordpress allow wp_options that are globals and wp_meta that are scoped to a single post/page.
                    Both can be shown has editable fields on any edit post/page.

                    Does getResourceField allow that kind of behaviour ?

                    One solution would be to create a TV, store it’s name as a system setting (global_tv_list), and create plugin onTemplateFormSave that will auto assign the TVs that are in the setting to the new created template.
                      • 33968
                      • 863 Posts
                      Quote from: lossendae at May 18, 2011, 03:54 AM

                      But the point of those global vars would be to be editable from a resource edit page, not from a CMP.
                      Do you mean that the field would show up when editing any resource - perhaps on a ’settings’ tab alongside the TVs tab? Sure, that would work, but as a personal preference I would rather have them in one separate location. Perhaps under the ’Site’ menu.

                      Consider this: when editing a resource, all fields available - pagetitle, content, tvs - apply only to the current resource. Why confuse things by adding site-wide settings in the same place? In that context a client might edit a global setting thinking it only applies to the current page, but then the whole site has changed. Also, why clutter the resource editing page with settings that are unlikely to be changed very often?

                      Those are just my thoughts... I would say both are valid implementations depending on the project wink