We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12556
    • 103 Posts
    I wrote a snippet a couple years ago for Evolution (before it was called that) and now I’m migrating the site to Revolution. In my snippet I made a call to $modx->config[’base_path’] but that doesn’t seem to exist in Revolution. I looked through the list of system settings found here http://rtfm.modx.com/display/revolution20/Settings but didn’t see anything that looked like it would return the same data. Suggestions? Thanks!
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      It looks like you would use:

      $basePath = $modx->getOption(’base_path’);

      You might also want to have a look at MetaX as I think that function is used in one or two places...

        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 12556
        • 103 Posts
        Oh. That’s not in the list I looked at. Where did you find that? And thanks!
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          It’s simply a modification (/guess) based on the code sample on the page linked. If you want to dig into things further you may want to look into: http://rtfm.modx.com/display/revolution21/Developing+an+Extra+in+MODX+Revolution

          Keep in mind some legacy code currently in 2.0.x will be removed in 2.1.x (the next release), so I would look in the Revolution 2.1 documentation area.

          Hope that helps.
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting
            • 3749
            • 24,544 Posts
            $modx->getOption(’base_path’) is definitely what you want.

            getOption() is the correct method for getting any System Setting.
              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
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: AMDbuilder at Mar 27, 2011, 07:43 PM

              Keep in mind some legacy code currently in 2.0.x will be removed in 2.1.x (the next release), so I would look in the Revolution 2.1 documentation area.
              Actually, that shouldn’t really be public yet tbh, and is just a clone of the 20 documentation at the moment. The documentation changes will be prepared over the next couple of weeks as the release candidate phase is completed.
                • 12556
                • 103 Posts
                Quote from: BobRay at Mar 27, 2011, 09:53 PM

                $modx->getOption(’base_path’) is definitely what you want.

                getOption() is the correct method for getting any System Setting.


                Okay. Thanks! Where can I find a complete listing of all the system settings? base_path is not listed at the link I referenced above.
                  • 1343 ☆ A M B ☆
                  • 2,213 Posts
                  The API documentation (http://api.modxcms.com/) might be a good place to look.
                    Patrick | Server Wrangler
                    About Me: Website | Tweets |  MODX Hosting
                    • 3749
                    • 24,544 Posts
                    Most of them are in System -> System Settings. Here’s a partial, unofficial list of the ones that aren’t in the System Settings grid:

                    [table]
                    [tr][td]Setting[/td][td]Tag[/td][/tr]
                    [tr][td]Site URL[/td][td][[++site_url]][/td][/tr]
                    [tr][td]Base Path[/td][td][[++base_path]][/td][/tr]
                    [tr][td]Base URL[/td][td][[++base_url]][/td][/tr]
                    [tr][td]Core path[/td][td][[++core_path]][/td][/tr]
                    [tr][td]Manager Path[/td][td][[++manager_path]][/td][/tr]
                    [tr][td]Manager URL[/td][td][[++manager_url]][/td][/tr]
                    [tr][td]Processors path[/td][td][[++processors_path]][/td][/tr]
                    [tr][td]Assets path[/td][td][[++assets_path]][/td][/tr]
                    [tr][td]Assets URL [/td][td][[++assets_url]][/td][/tr]
                    [tr][td]Connectors path[/td][td][[++connectors_path]][/td][/tr]
                    [tr][td]Connectors URL[/td][td][[++connectors_url]][/td][/tr]
                    [tr][td]URL Scheme[/td] [td][[++url_scheme]][/td][/tr]
                    [tr][td]HTTP Host[/td][td][[++http_host]][/td][/tr]
                    [/table]
                      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
                      • 28215
                      • 4,149 Posts
                      The reason, btw, those are not in the grid, is that they are Context-specific, and generated either in the config.inc.php file or at runtime. They’re not meant to be edited on a whim. tongue
                        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com