Robust
Well-known member
Wondering how to do this
Thing is, without the selected option the tab isn't shown as selected. But with it, it isn't either. I'm assuming the $selectedTabId isn't 'help'? I've tried changing title to $selectedTabId just to debug and see what it is, but it ends up blank (empty).
Am I doing something wrong?
My code event listener is simply a navigation_tabs event one, two of them, one for helpTab and one for upgradeTab.
PHP:
/**
* Adds a Help tab to the navigation
* @param array $extraTabs
* @param string $selectedTabId
*/
public static function helpTab(array &$extraTabs, $selectedTabId)
{
$extraTabs['help'] = array(
'title' => 'Help',
'href' => XenForo_Link::buildPublicLink('help'),
'linksTemplate' => 'helptab_links',
'selected' => ($selectedTabId == 'help'),
'position' => 'end'
);
}
/**
* Adds a Upgrade tab to the navigation
* @param array $extraTabs
* @param string $selectedTabId
*/
public static function upgradeTab(array &$extraTabs, $selectedTabId)
{
$extraTabs['upgrade'] = array(
'title' => 'Upgrade',
'href' => XenForo_Link::buildPublicLink('account/upgrades'),
'position' => 'middle'
);
}
Thing is, without the selected option the tab isn't shown as selected. But with it, it isn't either. I'm assuming the $selectedTabId isn't 'help'? I've tried changing title to $selectedTabId just to debug and see what it is, but it ends up blank (empty).
Am I doing something wrong?
My code event listener is simply a navigation_tabs event one, two of them, one for helpTab and one for upgradeTab.