How to add sublinks to navbar

JoshA

Member
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
96b51b597e18fe6f3e55bfc532964e67.png


Any advice would be very helpful!

Thanks,
Josh
 
I may be misunderstanding but you have defined the template:
Code:
'linksTemplate' => 'TicketSupport_QuickLinks',

So you would add the links there.
 
@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
 
Top Bottom