• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

Stuart Wright

Well-known member
#1
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?
 

Liam W

Well-known member
#2
What do you mean? Do you want files in the / folder to be displayed...?

They will by default, as long as they exist.
 

Adam Howard

Well-known member
#8
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.
 

Digital Doctor

Well-known member
#10
xen:link for internal URLs.
<a href="{xen:link 'threads/thread-title.71/'}">Thread</a>

....
Is there a way to make it easy for people to use xen:link ? like a popup ?
 

Jeremy

Well-known member
#11
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.