XF 1.2 How do I create a link in a page relative to the Xenforo root?

Stuart Wright

Well-known member
So we're setting up Xenforo in the /community folder.
But we're moving it to root when we go live. Can't move it to root before then because our current forums are installed in the /forums folder.

Lots of pages link to other pages on the site. Rather than create absolute links which will break when we move the site, can we create relative links which will work now and when we move?

What's the magic code please?
 
You should always use xen:link for internal URLs.

For example:
Code:
<a href="{xen:link 'threads/thread-title.71/'}">Thread</a>

Code:
<a href="{xen:link 'pages/page-title/'}">{xen:phrase page_name}</a>
@Brogan can you please add this into your Q & A resource. It would be very helpful to recall this at a later time.
 
Considering that there is no "editor" in the backend with pop ups, this would be a break and confusing behavior. The syntax is simple, and a pop up won't simplify it any further.
 
Top Bottom