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

Question regarding Media tab in the navigation bar

Discussion in 'Styling and Customization Questions' started by imthebest, Apr 14, 2015.

  1. imthebest

    imthebest Formerly Super120

    I'm just copying parts of a previous post (when XFMG didn't exist and it was Xen Media Gallery). The problem still exists and I have confirmed that it doesn't happen with other tabs.

    I have edited the navigation template to add two menu items:

    Code:
    <li class="navTab {xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}"><a href="{xen:link 'find-new/posts'}" rel="nofollow" class="navLink">{xen:phrase new_posts}</a></li>
    <li class="navTab {xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}"><a href="{xen:link 'account/news-feed'}" rel="nofollow" class="navLink">{xen:phrase your_news_feed}</a></li>
    The problem I have is that whenever I go to a page powered by XFMG, for example media/users/chris.123/albums then I see the following on my navbar:

    [​IMG]

    As you can see, my custom menu items also get focus! I have been told this:

    However when clicking on other tabs like Forums or Members the problem doesn't exists, I mean the Forums tab properly gets the focus without affecting any of my two custom tabs. The same happens when clicking on the Members tab. This problem seems to be affecting specifically the Media tab... maybe the tab is being too strict or have zero tolerance against the "selected" class being added to multiple tabs?

    Thanks,
    Super120
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    This isn't actually specifically related to XFMG:

    upload_2015-4-14_22-34-16.png

    As I said a long time ago, you have a mistake in the template.

    You can't add the 'selected' class based on the {$extraTab.selected} condition because the {$extraTabs} array contains specifically the data required for displaying navigation tabs created by add-ons.
     
  3. imthebest

    imthebest Formerly Super120

    If it is something easy to fix, could you please help me?
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Change this:
    Code:
    {xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}
    To:
    Code:
    Popup PopupControl PopupClosed
     
    imthebest likes this.

Share This Page