XF 2.0 Including template with Navigation item


Active member
In XF 1.x you could include a template with a navigation item, e.g:

$extraTabs['myNewLink'] = array(
            'title' => 'Navigation Link',
            'href' =>  'somepage',
            'selected' =>  ($selectedTabId == 'somepage'),
            'position' =>  'middle',
            'linksTemplate' => 'myNewLinkTemplate',
            'linksTitle' => 'somepage'
Is there a way to do this in XF 2.x? I can add a link and children to it to $navigationFlat and NavigationTree, but wondered if there was a way to do it specifically with a template instead.


XenForo developer
Staff member
You may be able to do things like this with a callback type, but it would generally be preferable to add navigation entries individually if possible. The navigation can be dynamically manipulated based on context and device.

You can see the node navigation type for an example that dynamically adds entries.


Active member
We have an extensive custom forum navigation item with a few different levels and icons (data-nav-id, yay), but thankfully I can save it to an add-on so I never ever have to do it again.
i would do something more advanced ;-) Can anybody help?
On click a customized sublinks template should be shown, the template includes a list of icons/graphics as links.

like stock:

in XF1 we could give the tab a param , 'linksTemplate' => '', but this didnt work on xf2