I’m trying to add the current page url to a link via a snippet.
Is there a way of getting the whole url of a page using the modx api. Something like this is what I’m after:
snippet called geturl for example:
$url = $modx>somethingHere;
return $url;
Code:
<a href="somepage.html?url=[[geturl]]">Link Text</a>
Result I want:
<a href="somepage.html?url=http://www.mysite.com/parent/child.html">Link Text</a>
Any pointers on how I might achieve the above?
Thanks!