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

XF 1.4 How to Hide Media Navigation Tab

#1
Hi, just to make it clear I know just enough to be dangerous. ;)

I would like to hide the Media navigation tab completely from non-logged in users and users that are not validated yet.

I have put together this code that I use elsewhere for the purpose of hiding stuff from non-logged in/not validated users:

Template: header
Code:
    <xen:if is="!{$visitor.user_id} or {$visitor.user_state} != 'valid'">
            <xen:require css="nav_tab_remove.css" />
    </xen:if>

nav_tab_remove.css (I created this css)
Code:
.navTabs .navTab.resources .navLink {display: none;}
.navTabs .navTab.media .navLink {display: none;}
".navTab.media" does not appear to be it's correct name, does anyone know what the correct name is, or do I need to handle the media tab differently. Thanks.
 

Mike

XenForo developer
Staff member
#2
It seems to me like you should just set permissions for the unregistered / unconfirmed group to not have access to the media gallery.
 
#3
Thanks Mike, Doh, I did not even notice you could set permissions for Media gallery.

That did the trick.

Appreciate the help as I reckon I would still be going around in circles if someone hadn't pointed it out.
 
#4
Instead of removing the Media navigation tab altogether, I just want to make it the last item on the navbar. We already have a number of navbar items, and if anything is going to get hidden in a burger menu I'd rather it be Media.

I'm trying to find the code responsible for injecting Media into the navbar, but I'm an amateur and can't find it in Templates > Navigation. Can you point me in the right direction?
 

Mike

XenForo developer
Staff member
#5
At best, you can change the "Navigation Tab Position" option. Otherwise, file/XML changes would be required (which would be overwritten on upgrade).
 

drastic

Well-known member
#7
I need to remove my media tab too. I use custom tabs that say "pictures" and "videos."

I don't use the end position on anything, so I'm OK with commenting that out of the navigation template, but not sure what code to do that to. I tried doing it, but it also erased my sub nav.

What can I comment out?

@Chris D - maybe future suggestion is an option to have no navigation item appear? Or let us choose which categories to appear in nav, but "media" is just not an enticing word to use and doesn't attract many SEO visits.