XF 1.4 Is there a way to grab the current URL using a {xx} command?

MarkMark

Member
This is a little hard to explain, but I am trying to create a Notice that includes a link that is relative to the page currently being viewed.

Essentially I'm trying to do the following:
Code:
<a href="{current_url}/my_own_variable">

Sadly current_url is just made up, but I'm hoping there might be a way to grab the current URL, a bit like how you can grab the current username using {name}.
 
As I essentially just need to add "calendar-add" after the current URL, I thought I could just go for:

Code:
<a href="/calendar-add">click here</a>

Sadly, because XenForo uses a Base tag in the header, this doesn't work.
 
Thanks for that. In the end I just used javascript, and the document.URL variable. So created:

Code:
<a href="javascript:location.replace(document.URL + 'calendar-add')">Link</a>

Seems to work.
 
Back
Top Bottom