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

XF 2.0 Including template with Navigation item

adamsmasher

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

Code:
$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.
 

Mike

XenForo developer
Staff member
#2
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.
 

adamsmasher

Active member
#5
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.