XF 2.0 Links to nodes (forum or page)?

b94

Member
How can I create links to other pages and forum sections from a page in XenForo 2?

The following works for pages, but i'm not sure if it's correct:
Code:
<a href="{{ link('pages/name/') }}">Name</a>

But the following does not work for forums and adds in a "/-/":
Code:
<a href="{{ link('forums/xenforo-questions-and-support.25/') }}">Name</a>

I can see ""{{ link('forums', $node) }}"" used in templates, but couldn't get this to work by subsituting $node for the node id.
 
If it is a page you are linking from, you can just use the plain html link

Code:
/forums/xenforo-questions-and-support.25/

or full URL

Code:
https://xenforo.com/community/forums/xenforo-questions-and-support.25/
 
  • Like
Reactions: b94
How can I create links to other pages and forum sections from a page in XenForo 2?

The following works for pages, but i'm not sure if it's correct:
Code:
<a href="{{ link('pages/name/') }}">Name</a>

But the following does not work for forums and adds in a "/-/":
Code:
<a href="{{ link('forums/xenforo-questions-and-support.25/') }}">Name</a>

Did you figure out the proper way to add forum links?

I ran into the same problem. It adds a "-/" between forums/ and xenforo-questions-and-support.25/. The above code results in the following link:
Code:
forums/-/xenforo-questions-and-support.25/
 
Top Bottom