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

How to add sublinks to navbar

#1
Hello,

Just trying to work out how I would add sublinks to the navbar for a custom navtab I have already made.
I would want to achieve this though template hooks.

Here is my current class for adding the Nav Tab
Code:
public static function addNavTab(array & $extraTabs, $selectedTabId)
    {
      $addonIsActive = XenForo_Application::get('options')->enableTicketSupport;

      if($addonIsActive)
      {
         $extraTabs['mynavmenu1'] = array(
            'title' => new XenForo_Phrase('Tickets'),
            'href' => XenForo_Link::buildPublicLink('full:tickets'),
            'linksTemplate' => 'TicketSupport_QuickLinks',
            'selected' => ($selectedTabId == 'tickets'),
            'position'  =>  'middle'
         );
      }
    }
I'm wanting to add the links to the subnav bar


Any advice would be very helpful!

Thanks,
Josh
 

Brogan

XenForo moderator
Staff member
#2
I may be misunderstanding but you have defined the template:
Code:
'linksTemplate' => 'TicketSupport_QuickLinks',
So you would add the links there.
 
#3
@Brogan Think you have it spot on, I may be getting confused also but in that template I have
Code:
<ul class="secondaryContent blockLinksList">
<li><a href="http://www.example.com/link1" target="_blank">Open New Ticket</a></li>
<li><a href="http://www.example.com/link1" target="_blank">Your Tickets</a></li>
</ul>
That adds the quick-links in the drop down of tickets tab, I'm guessing I am missing code for it to appear in sub nav when selected.

------ Doh -----
Nailed it.. in the listener I didn't define the tab's name which prevented the links showing