We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3109 ☆ A M B ☆
    • 894 Posts
    Quote from: BobRay at May 18, 2011, 12:43 AM

    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"?


    Bob they’re template variables that I have on the settings page and then I access them via getResourceField throughout the site. So technically the settings page acts as the global variable for each site since it contains all of the data pertaining to that site.

    It works great, haven’t had any issue so far.
      Benjamin Marte
      Interactive Media Developer
      Follow Me on Twitter | Visit my site | Learn MODX
      • 23571
      • 223 Posts
      I have been creating a Configuration context. It contains a single document called Settings. I use getResources from the web context to retrieve any TV from the Configuration context.
        • 38355
        • 38 Posts
        Hey,

        It would be great to have TVs available on the web resource and then they could act as global content across all templates and resources.

        Creating a resource for footer content works as well but it seems like overkill to create a entire document just for a footer.

        TVs on the web resource would allow for non-HTML users to update global content in one spot.

        Cheers
          Revolution 2.2.0
          Developer not a programmer...
          • 3749
          • 24,544 Posts
          Is there some reason you don't want to use System Settings? That's what they're for and they would be *way* faster.


          ---------------------------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
          MODx info for everyone: http://bobsguides.com/MODx.html
            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
            • 3109 ☆ A M B ☆
            • 894 Posts
            What you are looking for is called a context setting and they are one of the best things ever they come in real handy for multi-context sites and regular ones as well.
              Benjamin Marte
              Interactive Media Developer
              Follow Me on Twitter | Visit my site | Learn MODX
              • 3749
              • 24,544 Posts
              @benmarte -- Yes, but you'd want to use System Settings instead if you wanted the settings to be available everywhere on the site.

              ---------------------------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
              MODx info for everyone: http://bobsguides.com/MODx.html
                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
                • 38355
                • 38 Posts
                @BobRay- so would you use system settings for things like footer content rather than a resources?
                  Revolution 2.2.0
                  Developer not a programmer...
                  • 3749
                  • 24,544 Posts
                  No, I would never put content in a System Setting. I would put that in a chunk if I wanted to use it in multiple templates.

                  Think of System Settings as small bits of information for use by MODX processes around the site. They're very similar in function to properties (like the ones you put in a snippet tag) except that properties are local in scope (IOW, they can only be seen by the element they are attached to), wheras system settings can be seen from anywhere on the site.

                  If you browse through the MODX System Setting grid in Revolution, you should get a pretty good idea how they are used. The vast majority are one of the following:

                  - Boolean Yes/No switches (use Friendly URLs or not)
                  - Integers (how many minutes to block a use who screws up logging in)
                  - Paths (where is the rich text editor directory)
                  - Short text strings (what's the name of the rich text editor, what's the SMTP password)

                  Notice that these all answer some question a process might need to know the answer to.


                  ---------------------------------------------------------------------------------------------------------------
                  PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
                  MODx info for everyone: http://bobsguides.com/modx.html
                    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
                    • 3722
                    • 171 Posts
                    Ok, I have created some custom System Settings.
                    How do I make them easily accessible for an editor to view and update?

                    Can I list them on a Custom Manager Page or Resource?
                      • 4172
                      • 5,888 Posts
                      I think ClientConfig is, what you are looking for
                      http://modx.com/extras/package/clientconfig
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!