1. 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?

Discussion in 'XenForo Questions and Support' started by Trekkan, Dec 13, 2011.

  1. Trekkan

    Trekkan Well-Known Member

    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!
  2. Brogan

    Brogan XenForo Moderator Staff Member

    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.
  3. Trekkan

    Trekkan Well-Known Member

    Thanks Brogan, so is there any common hook/file/location that I can look for/in?
  4. Trekkan

    Trekkan Well-Known Member

    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.
  5. Trekkan

    Trekkan Well-Known Member

    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.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    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.
  7. Trekkan

    Trekkan Well-Known Member

    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!
  8. Brogan

    Brogan XenForo Moderator Staff Member

  9. Bob

    Bob Well-Known Member

    If its LNBlog...

    template = lnblog_tab_links

    <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>
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Here is an idea for you:

    Trekkan likes this.
  11. Trekkan

    Trekkan Well-Known Member

Share This Page