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
-
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.
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*]~] ?
-
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*]~]