Hi all,
Maybe this is a really dumb question...but what is the best way of creating a URL to an internal document inside a snippet? I’m simply creating a url and appending some parameters but I really want the links to just pick up the root path automatically.
I’m hoping to move to friendly URLs in future if this makes a difference.
Any assistance appreciated
Cheers
Steve
-
MODX Staff
- 10,725 Posts
Yes, it’s always best to generate URL’s in MODx snippet code using $modx->makeUrl(). This is more efficient and reliable than returning tag links in your output, e.g. [~56~], which must then be parsed in another sweep through the parsing algorithm.
Thanks for the replies both - exactly what I was after!
Got to love APIs - make things far more straightforward for newbies like myself.
Cheers
Steve