$_GET in the URL

Is there a built-in way to send $_GET data in the friendly URL's? I've tried a few combinations and anything extra redirects back to the homepage.




Well-known member
my call back is ready, i just can't get past putting GET data in the URL's
You should use XenForo built in functions to build links. Any way, the link you posted above will not work. Try to change it to:


And see if the data gets populated to the $_GET array.


Well-known member
{xen:link route/action}

There's more that you can pass to it (parameters, etc.) and it runs through the route class and will generate an appropriate link. You can find examples all over the templates of this. :)


Well-known member
JulianD, what are the proper functions to build links?
If you have your url route on a string variable, building a link is as simple as this:

Or if you'd like to use the route's built in function to build a link, the syntax is usually as follows:

XenForo_Link::buildPublicLink('members', $user);
XenForo_Link::buildPublicLink('posts', $post);
XenForo_Link::buildPublicLink('threads', $thread);
The first parameter is the route prefix that should be used, the second parameter is an array containing the required variables to build a link related to the route you're using. If you take a look at the thread route prefix (library/XenForo/Route/Prefix/Threads.php, there's a function called buildLink(). By calling XenForo_Link::buildPublicLink('threads', $thread), you are effectively calling the buildLink function within the Threads route.

XenForo uses some standardized url structure that you may be already familiar with. The format is somewhat like this:


But in cases where a parameter is required, such in this thread url, where the thread_id is needed, XenForo supports another commonly used url structure:


If we take this thread url as an example, the above variables would be:

prefix: threads
param: _get-in-the-url.58145
action: empty (default action, which usually means "index")

Anyway, you can even create your own routes with very complex url structures if you ever need to, completely outside of what XenForo already uses. You just need to code the proper route functions to support your url structures :)