Add "?forum_id" to thread links


Well-known member
You'd have to edit the route and add it as a parameter at build time. I can't give you an example right now because I'm mobile.

Jake Bunce

XenForo moderator
Staff member
Need to extend this:


Thread records contain the node_id, though it might not be safe to assume the node_id is available. Might have to do an isset() check on that before adding it to the link.


Well-known member
I added $thread['myforumId'] = 5 to ControllerPublic_Thread::actionIndex and I can see this variable on XenForo_Route_Prefix_Threads::buildLink with $extraParams['test'] = var_dump($data);

array(35) {
["thread_id"]=> int(2)
["node_id"]=> int(2)
["title"]=> string(4) "testtitle"
["myforumId"]=> int(5)}
This adds the title to the url: $extraParams['test'] = $data['title']; But $extraParams['test2'] = $data['myforumId']; does not work. Do you have any idea why my variable is displayed in the dump:$data, but it does not work here? Thank you so much.