• 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

imthebest

Well-known member
#1
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:



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

"You've made a mistake in your template. The "selected" class is being added to multiple tabs, while the media one is selected."
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
 

Chris D

XenForo developer
Staff member
#2
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.
 

Chris D

XenForo developer
Staff member
#4
Change this:
Code:
{xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}
To:
Code:
Popup PopupControl PopupClosed