1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Not possible to set selexted extratab without an linktemplate

Discussion in 'Resolved Bug Reports' started by ragtek, Oct 22, 2010.

  1. ragtek

    ragtek Guest

    I created a extra tab for a add-on
    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'),
            );
        }
    }
    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.

    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>
    to
    Code:
    <li class="navTab {xen:if $extraTab.selected, 'selected', 'PopupClosed'}"><a href="{$extraTab.href}" class="navLink">{$extraTab.title}</a></li>
    
    
    and now it's working
     
    Sniper likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    It needs a bit more than that so that the second line of the navigation actually has something, but I have done this for the next release.
     
  3. Floris

    Floris Guest

    Ah, so it's not just me. Ok! Thanks for the fix and looking forward to beta 4.

    Pssst, timeframe for beta 4 = somewhere during December, despite law suits and holiday season?
     

Share This Page