We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    I know there’s document variables for longtitle, etc., but I swore there was one for grabbing the current URL...
      My Snippets
      -> PopUpChunk v1.0
      • 25663 MODX Staff
      • 12,272 Posts
      A relative URL can be written by doing the following: [~[*id*]~]

      Full URL: [(site_url)][~[*id*]~]
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 33372
        • 1,611 Posts
        Within a snippet or plugin you can create a URL for the current page using $modx->makeURL($modx->documentIdentifier)

        Although you’d only really need to do that for the current page if you wanted to be sure that the URL you have is correct (according to your SEO or other rules) and it’s possible for it not to be (e.g., you’re not using the SEO Strict plugin), since otherwise you can just grab the URL from PHP’s built in vars ($_SERVER["REQUEST_URI"]).
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options