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

How do mods add tabs to main navigation?

Trekkan

Well-known member
#1
Sorry if this isn't the correct forum, couldn't really find anywhere better to post it.

I have several mods that have added tabs to the main navigation and I'd like to move them into their own area. Adding them where I want them isn't a problem, the problem is, removing them from the primary navigation. They don't contain any options within them as to whether or not to add themselves to the nav.

So, my question is, is there a common way that these are added? I know in vB it was using a specific hook in a plugin and if you disabled that, it'd go away. Basically, I'm looking for how to do that with xF, thanks!
 

Brogan

XenForo moderator
Staff member
#2
They are either added using hooks or template edits.

If using hooks, they can be placed at the front, middle or end of the navigation bar.

There is a value which is applied to each tab, determining its position in relation to the other tabs.
 

Trekkan

Well-known member
#4
Ok, figured it out. Had to turn on debug mode, then I was able to see the development area, then code listeners, then disabled the ones that created the tabs I didn't want. Thanks.
 

Trekkan

Well-known member
#5
Ok, I take it back... heh

Basically, this did disable the primary nav links, but it also disabled the secondary menus that need to be there.

As an example, I'm trying to disable the primary nav tab entry for the Blogs mod I have. It has sub navigation that displays when you click the tab. Normally. If I disable the listener for the primary navtab, it also disables the secondary links, even when you're on the page for the Blogs.

So, any suggestions on how I would go about ONLY disabling the primary tab? Is that even possible? In looking at the listener, it seems that sub navigation is built off of the primary navtab. Which would seem then it'd impossible to display only the sub navigation.
 

Brogan

XenForo moderator
Staff member
#6
Sorry, I was busy doing eleventeen other things to respond.
Yes, it's only possible in debug mode to see that information.
Editing the callback execution order will change the position relative to other tabs.

And no, you can't disable the primary tab but keep the secondary links.

You could always add them directly to the navigation template.
 

Trekkan

Well-known member
#7
No worries Brogan, was just typing things out as I discovered them. =)

Thanks for the info, knowing I can't do it by simply disabling the code listeners for it, helps. I'll see about adding them directly to the template as you mentioned. No idea how, but... well I'll give it a shot, thanks!
 

Bob

Well-known member
#9
No worries Brogan, was just typing things out as I discovered them. =)

Thanks for the info, knowing I can't do it by simply disabling the code listeners for it, helps. I'll see about adding them directly to the template as you mentioned. No idea how, but... well I'll give it a shot, thanks!
If its LNBlog...

template = lnblog_tab_links

HTML:
<xen:if is="{$visitor.user_id}">
    <ul class="secondaryContent blockLinksList">
        <xen:if is="{$visitor.permissions.lnblog.create}"><li><a href="{xen:link 'blogs/create-entry'}">{xen:phrase lnblog_create_new_entry}</a></li></xen:if>
        <li><a href="{xen:link blog, $visitor}">{xen:phrase lnblog_my_blog}</a></li>
    </ul>
</xen:if>
 

Jake Bunce

XenForo moderator
Staff member
#10
Ok, I take it back... heh

Basically, this did disable the primary nav links, but it also disabled the secondary menus that need to be there.

As an example, I'm trying to disable the primary nav tab entry for the Blogs mod I have. It has sub navigation that displays when you click the tab. Normally. If I disable the listener for the primary navtab, it also disables the secondary links, even when you're on the page for the Blogs.

So, any suggestions on how I would go about ONLY disabling the primary tab? Is that even possible? In looking at the listener, it seems that sub navigation is built off of the primary navtab. Which would seem then it'd impossible to display only the sub navigation.
Here is an idea for you:

http://xenforo.com/community/threads/move-menu-items.20654/#post-263851