We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3232
    • 380 Posts
    I know this is probably sitting right in from of me, but i can’t find a parameter or variable that will output the current page’s friendly url.

    Everything i can find related to a ditto call when this is going to be used for a send to a friend form.

    Thanks
    Brian
      • 22303 MODX Staff
      • 10,725 Posts
      In snippets and plugins, you would use $modx->makeUrl(1) where 1 is the id of the MODx document. In the templates, chunks, and other MODx content where you normally place HTML, you can use the link tags, e.g. [~1~], again where 1 is the id of the MODx document you want to produce the URL for.
        • 3232
        • 380 Posts
        ok this is in a chunk so i will have to use the link tags... how would i about finding the current documents id?

        link tags

        [~[*id*]~] ?
          • 22303 MODX Staff
          • 10,725 Posts
          That’s correct, [~[*id*]~] will create a link to the current page... if you need the complete url with the scheme/domain/etc. (the regular link returned will be relative to the site root), you can prefix it with the site url property -- i.e. [(site_url)][~[*id*]~]
            • 3232
            • 380 Posts
            Quote from: OpenGeek at Apr 29, 2007, 05:46 PM

            That’s correct, [~[*id*]~] will create a link to the current page... if you need the complete url with the scheme/domain/etc. (the regular link returned will be relative to the site root), you can prefix it with the site url property -- i.e. [(site_url)][~[*id*]~]

            Excellent this is exactly what I was looking for.

            Thanks,
            Brian