Pages vs navigation highlighting


Active member
I've got a couple of pages:
and quite likely to build a couple more.

What I would like to do is have links in my navigation bar (as I have) but change the selected tabs.
It looks like I have to change the current to class "selected", and change the forums tabs a bunch of way.

Can anyone give me some guidance please?
How would I go about doing this?



Well-known member
The selected tab is assigned based on the major section parameter in the Route Prefix. In the Pages route, that's this line:

return $router->getRouteMatch('XenForo_ControllerPublic_Page', 'index', 'forums');
I released a hack a while back that lets you mangle the node name and get a custom tab selected. It can be extended to only account for certain tabs. However, if you know some PHP and how to write a XenForo addon, it might be a better idea (more fun?) to create your own route prefix. Only drawback I can see doing it that way (and I've only given it a cursory thought) is that it wouldn't link correctly when displayed in the node tree.

Here's the mod I did, for reference.


Active member
mmm I do know php (a bit :) )
but clearly I need to read a bit more ;)

I have used PageCallBacks for each of my pages (or at least most of them)
and I'm returning $response .. can I also branch off and do something with $router->getRouteMatch ?


Well-known member
I haven't gone through the whole stack, but I don't think the router is in scope once you get into the Controller.