• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

NavManager

Astrum

Active member
I wrote this (somewhat) little navigation manager to help out board administrators organize their navigation bar as well as learn XenForo. This is probably the fourth or fifth revision I've done internally, one being complex enough to support tabbed breadcrumb navigation. All of them were horrendously buggy and hacky though, so I finally settled on this version.

Please note that while I am a software engineer, I've never done any web development work before, so I have little experience with PHP (or JavaScript which I did a bit of). Coupled with the fact that I'm learning XenForo there are probably areas where I could have done things better. Feel free to comment if you dig through the source. I'd also like to say that I looked over and used modified versions of the admin_navigation stuff (as well as a lot of other bits) to make this.

The Good:
  • It works as far as I know. I've tested it along the way, but if there's anything I've learned from software development it's that someone, somewhere can break it =). So please report any bugs, I'm sure there are plenty.
  • It supports adding both primary and secondary tabs. It automatically creates the necessary phrases as well as the links templates. This add-on essentially usurps the way XenForo currently handles custom tabs.
  • It also should support other add-on tabs, although add-on tabs will be added after tabs in this add-on. I haven't actually tested this, so take it with a grain of salt.
The Bad:
  • I had to limit things all around. While it calls it a tree in the Applications menu, it's limited to a shallow one. Only primary links and secondary links are allowed. You can't have a tertiary link or anything like that. Most likely not a problem, but it is a limitation.
  • Adding a navigation node can be a bit confusing, so please ask if you have any questions.
  • Style support I couldn't really figure out. If you have a sufficiently different style you might have to do some editing of the navmanager_header and navmanager_navigation templates. These replace the header and navigation templates since there was no suitable hook in the navigation template to remove the default tabs.
The Ugly:
  • There's no proper permissions support in this version. Secondary links have a permissions field you can enter (possibly with the help of a callback function to load the necessary data), but Primary links do not have any permissions. If it's primary, it is always visible. Even though secondary links can have permissions, the way it's used isn't exactly user friendly.
Well now that I've scared you all away, here are some pictures!

Screen shot 2011-03-31 at 4.07.41 PM.webpScreen shot 2011-03-31 at 4.08.22 PM.webpScreen shot 2011-03-31 at 4.09.21 PM.webp

Known Bugs:
  1. Overlay links aren't working properly. This will be fixed in the next release. To fix it yourself you can go to AdminCP->Home->Options->Navigation Manager and change the Meta Link Template field to look like this:
    Code:
    <li><a href="{$link}" {$overlay}>{$title}</a></li>
    Then go to each primary navigation node and re-save it.
  2. The Data field won't be passed if there are no Extra Parameters set. This will be fixed in the next release.
  3. Localization for secondary links won't work. This will be fixed in the next release.
Planned Features:
  1. Usage guide
  2. XML import/export ability
  3. A better permissions system.
 

Attachments

Oooohhhhh.... nice work, this has tremendous potential. I was waiting to see who would begin a fully fledge navigation manager, as addon's begin to get ugly as more things are added, and need a more custom solution, more often than not, to merge product links together under common tabs.
 
I don't know the add-on but the introduction is entertaining :D Looking forward to see more work of yours Astrum. I will install it on a test enviroment and provide feedback if needed.
 
I wrote this (somewhat) little navigation manager to help out board administrators organize their navigation bar as well as learn XenForo. This is probably the fourth or fifth revision I've done internally, one being complex enough to support tabbed breadcrumb navigation. All of them were horrendously buggy and hacky though, so I finally settled on this version.

Please note that while I am a software engineer, I've never done any web development work before, so I have little experience with PHP (or JavaScript which I did a bit of). Coupled with the fact that I'm learning XenForo there are probably areas where I could have done things better. Feel free to comment if you dig through the source. I'd also like to say that I looked over and used modified versions of the admin_navigation stuff (as well as a lot of other bits) to make this.

The Good:
  • It works as far as I know. I've tested it along the way, but if there's anything I've learned from software development it's that someone, somewhere can break it =). So please report any bugs, I'm sure there are plenty.
  • It supports adding both primary and secondary tabs. It automatically creates the necessary phrases as well as the links templates. This add-on essentially usurps the way XenForo currently handles custom tabs.
  • It also should support other add-on tabs, although add-on tabs will be added after tabs in this add-on. I haven't actually tested this, so take it with a grain of salt.
The Bad:

  • I had to limit things all around. While it calls it a tree in the Applications menu, it's limited to a shallow one. Only primary links and secondary links are allowed. You can't have a tertiary link or anything like that. Most likely not a problem, but it is a limitation.
  • Adding a navigation node can be a bit confusing, so please ask if you have any questions.
  • Style support I couldn't really figure out. If you have a sufficiently different style you might have to do some editing of the navmanager_header and navmanager_navigation templates. These replace the header and navigation templates since there was no suitable hook in the navigation template to remove the default tabs.
The Ugly:
  • There's no proper permissions support in this version. Secondary links have a permissions field you can enter (possibly with the help of a callback function to load the necessary data), but Primary links do not have any permissions. If it's primary, it is always visible. Even though secondary links can have permissions, the way it's used isn't exactly user friendly.
Well now that I've scared you all away, here are some pictures!

View attachment 13340View attachment 13341View attachment 13342
Any possibility of retaining add-on tab positions?
 
Unfortunately no. You could recreate the add-on navigation links in this, position it how you want it, and disable the add-on's navigation_tabs event listener.
 
The structure is great. Fairly easy to use. Do you plan on having tabs highlight on selection for a future release?
 
Tab highlighting is already somewhat supported merely because of the XenForo backend. For instance if you were to recreate the [LN]Blog tab in this add-on and everything was entered properly then the Blog tab should be selected and everything will work[1][2]. I will look into improving this though, as well as implementing a better permissions system. I've also been toying around with the idea of forcing links (both primary and secondary) to be "subordinate" if you will. Somewhat how this add-on works. I would have to look into this further though.

[1] In this particular example the Blog tab is hidden in the add-on if the user doesn't have the lnblog:view permission. Unfortunately the tab will show up with this add-on as primary tabs don't have permissions associated with them.
[2] I found a bug while looking into this, expect an update shortly.
 
Tab highlighting is already somewhat supported merely because of the XenForo backend. For instance if you were to recreate the [LN]Blog tab in this add-on and everything was entered properly then the Blog tab should be selected and everything will work[1][2]. I will look into improving this though, as well as implementing a better permissions system. I've also been toying around with the idea of forcing links (both primary and secondary) to be "subordinate" if you will. Somewhat how this add-on works. I would have to look into this further though.

[1] In this particular example the Blog tab is hidden in the add-on if the user doesn't have the lnblog:view permission. Unfortunately the tab will show up with this add-on as primary tabs don't have permissions associated with them.
[2] I found a bug while looking into this, expect an update shortly.
I sort of get what youre saying lol. The addon itself feels really solid, Im just not sure about all the terms, maybe a quick tutorial for the n00bs like me if you have time
 
Yeah, one of the bugs I'm trying to fix right now. Another one is the Data field not being passed properly if there are no extra parameters.
 
This has a few bugs, the one that caused me to uninstall it was, in the editor, the Insert/Edit Link and the Unlink buttons would not work, once uninstalled the problem was gone. Anyone else noticed it? Also as stated above, the flexile style is messed up. :)
 
That is a very strange bug, especially since I don't touch anything related to the editor. Is this only while using the flexile theme or does this happen when using the default theme as well? What other plug-ins are installed? And what do you mean when you say the Insert/Edit Link and Unlike buttons don't work? Are they just grayed out when text is selected? Or do they kind of work but don't do what they should?

As far as using custom styles with this I'm aware that it usually won't work with a sufficiently different style (such as flexile). There were no suitable xen:hooks in the navigation template for me to remove the default tabs, so I had to replace the header and navigation templates. The custom templates this uses are named navmanager_header and navmanager_navigation. They are identical to the originals except the navmanager_header includes navmanager_navigation rather than navigation, and the navmanager_navigation removes the Home, Forums, Members, and Help tabs (and sub tabs) but leaves everything else. All tabs made in this will be inserted into the extraTabs.home field which is built into XenForo.

So if you want it to work with a custom style you'll have to do some template edits, though it shouldn't be too bad unless it's extremely custom. So for Flexile you can open up the navmanager_header template and make it looks like this:

Code:
<xen:hook name="header">
<div id="header">
    <xen:if is="@showRightContentArea"><xen:include template="right_content_area" /></xen:if>
    <xen:include template="logo_block" />
    <xen:include template="navmanager_navigation" />
    <xen:if is="{$canSearch}"><xen:include template="search_bar" /></xen:if>
</div>
</xen:hook>

The navmanager_header template should look identical to the header template in a specific style except it should include navmanager_navigation rather than navigation. Similarly for the navmanager_navigation template use the default navigation template in whatever style you're using as the base, then remove the home, forums, members, and help sections but leave everything else like it is. I'm not going to post that template as it's quite large, but you get the idea. This add-on should work fine with a style after taking these steps.

I wish there was a better way to do this, but unfortunately we're stuck doing this for now. Perhaps I'll create a repository of style specific navmanager templates if anyone wants to make a few. I might contribute a flexile specific one since I'm using that style until I can find time to build a custom one. Although I'm actually hoping XenForo gets a proper navigation manager that can put mine to shame some day soon =).

Quick update on the next version. I've actually fixed the bugs, I fixed them within minutes actually. However, the upgrade process for this particular add-on is a bit rough because of how XenForo manages it. So I'm working on a way to fix this, at least to some extent. I've already implemented the ability to export navigation nodes to an XML file, so add-on authors who create custom tabs can, if they feel like it, make tabs for this add-on and include the XML file. It also allows you and this add-on to backup navigation nodes (which is needed for upgrade purposes).

Hopefully I'll have it out sometime soon.
 
This has a few bugs, the one that caused me to uninstall it was, in the editor, the Insert/Edit Link and the Unlink buttons would not work, once uninstalled the problem was gone. Anyone else noticed it? Also as stated above, the flexile style is messed up. :)
Flexile and many of the more customized styles make changes to the navbar and require you to modify the NavManager template.
 
Does this Addon satisfy this request ?

[Suggestion] Advanced Navigation Tabs and Sub-Tabs
http://xenforo.com/community/thread...ion-tabs-and-sub-tabs.2670/page-3#post-161136

navigation-tree-with-tab-order-as-well-jpg.11041
 
It will suffice, although there are things it can't do such as true add-on support where extra public tabs are distributed in the add-on XML. I'll be making a list of suggestions about this to the XenForo team sometime soon.
 
This deserves to be on page one. I use Robotic as my board style, which is heavily customized, so I'm waiting for a future release, but I'm closely watching!
 
Top Bottom