How to Set the Selected NAV Button?


Well-known member
I have created some external pages which work fine with custom blocks, breadcrumb, nav buttons. But when I go to a page that is routed to a nav button, it is not being styles as selected.

Here is the button setup:
$extraTabs['schedule'] = array(
'title' => new XenForo_Phrase('Schedule'),
'href' => XenForo_Link::buildPublicLink('full:en/schedule/'),
'selected' => ($selectedTabId == 'schedule'),
'position' => 'middle',

When extending the controllerPublic, do I set the selectedTabId there? Or should XenForo do this automatically?



Well-known member
It's actually assigned within the route prefix class, in your match function. It's the third parameter passed to $router->getRouteMatch.


Well-known member
SWEET this worked. And once I fixed this my breadcrumbs were created properly as well.

I am just checking things off the list today, GOOD TIMES!