R
ragtek
Guest
I created a extra tab for a add-on
The normal behaviour would be, that the tab is "selected" when i click on it, but that's not happening.
After spending 2 days searching for a solution and debugging, i found it in the navbar template
I'm not sure if it's working as designed, but IMHO it should also be possible to set the tab as selected without having a linktemplate because i don't need it.
ATM it's not possible to set a tab selected, if you don't have a link template.
I changed
to
and now it's working
PHP:
class Ragtek_Linklist_StaticMethods
{
static public function addTab(array &$extraTabs, $selected)
{
$extraTabs['links'] =array(
'title' => new XenForo_Phrase('ragtekLinklist'),
'selected' => ($selected == 'links'),
'href' => XenForo_Link::buildPublicLink('links'),
);
}
}
After spending 2 days searching for a solution and debugging, i found it in the navbar template
I'm not sure if it's working as designed, but IMHO it should also be possible to set the tab as selected without having a linktemplate because i don't need it.
Code:
<xen:if is="{$extraTab.linksTemplate}">
<li class="navTab $extraTabId {xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}">
<a href="{$extraTab.href}" class="navLink">{$extraTab.title}</a>
.....
.....
</li>
<xen:else />
<li class="navTab PopupClosed"><a href="{$extraTab.href}" class="navLink">{$extraTab.title}</a></li>
</xen:if>
ATM it's not possible to set a tab selected, if you don't have a link template.
I changed
Code:
<li class="navTab PopupClosed"><a href="{$extraTab.href}" class="navLink">{$extraTab.title}</a></li>
Code:
<li class="navTab {xen:if $extraTab.selected, 'selected', 'PopupClosed'}"><a href="{$extraTab.href}" class="navLink">{$extraTab.title}</a></li>