We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14281
    • 120 Posts
    I’ve noticed that the [~[*id*]~] syntax doesn’t actually output the full path to a document, i.e. the absolute path. It’s always the relative path in reference to the document root.

    Is there a way to change this behavior, or do I always have to type [(site_url)][~[*id*]~] to get this result?
      • 27376
      • 576 Posts
      There is no way to change [~x~] behavior, as it is designed to be used in conjunction with [tt]<base href="[(site_url)]"/>[/tt]. There may be faster ways to accomplish absolute url output, but I would need to know how you intend to use the functionality.
        • 23491 ☆ A M B ☆
        • 1,056 Posts
        Quote from: jlivingston at Apr 10, 2007, 04:45 PM

        I’ve noticed that the [~[*id*]~] syntax doesn’t actually output the full path to a document, i.e. the absolute path. It’s always the relative path in reference to the document root.

        Is there a way to change this behavior, or do I always have to type [(site_url)][~[*id*]~] to get this result?

        Personally, I use [~[*id*]~] in conjuction with <base href> and it’s golden. However, if you need absolute path for some other reason, then that’s a different story smiley
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 27376
          • 576 Posts
          I don’t know I didn’t think of this before but... You can make a plugin automatically prepend [(site_url)] to all [~x~] links.

          Simply make the plugin trigger when [tt]OnParseDocument[/tt] is called and [tt]preg_match(’#\[\~([0-9]+)\~\]#i’,$modx->documentContent, $matches);[/tt]

          EDIT: I’m just about to go to bed, so this post is a placeholder so I won’t forget my idea smiley More tomorrow.