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.
 
#6
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:
1531729088897.png

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