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

Implemented Please provide a tab highlight option in Route Prefix

Discussion in 'Closed Suggestions' started by AndyB, May 9, 2014.

  1. AndyB

    AndyB Well-Known Member

    When we create a Route Prefix, it would be really nice to have an option to select if the route should highlight a tab. In cases where the route prefix also has a matching tab it would not only highlight the tab but show in the breadcrumb as well.

    To create the tab I use Template Modifications to modify the "navigation" template by adding the following:

    <!-- extra tabs: end -->
    <li class="navTab PopupClosed"><a href="{xen:link example/}" class="navLink">{xen:phrase example}</a></li>
    Thank you.
  2. Jeremy

    Jeremy Well-Known Member

    You need to specify it in the class that is used to run the route prefix. And tabs need to a class to identify them.
    Last edited: May 9, 2014
    AndyB likes this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    That is not the correct way to create a navigation tab.

    There is a "navigation_tabs" event listener specifically for this purpose. If you have created your own route prefix, you can specify the "major section" which activates the navigation tab that has a matching ID.

    If you have not created your own route prefix, it is possible to override the active navigation tab in code:

    AndyB and Brogan like this.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    AndyB likes this.
  5. AndyB

    AndyB Well-Known Member

    Last night when I tried it I couldn't get it to work, so I assumed it was too difficult for me. I tried it again and now it works. It's really not that difficult.

    Thank you, Jeremy, Chris and Paul for your help.

Share This Page