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

Discussion in 'XenForo Questions and Support' started by Craig W, May 9, 2015.

  1. Craig W

    Craig W New Member

    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
        <xen:if is="!{$visitor.user_id} or {$visitor.user_state} != 'valid'">
                <xen:require css="nav_tab_remove.css" />

    nav_tab_remove.css (I created this css)
    .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.
  2. Mike

    Mike XenForo Developer Staff Member

    It seems to me like you should just set permissions for the unregistered / unconfirmed group to not have access to the media gallery.
  3. Craig W

    Craig W New Member

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

    okhello Member

    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?
  5. Mike

    Mike XenForo Developer Staff Member

    At best, you can change the "Navigation Tab Position" option. Otherwise, file/XML changes would be required (which would be overwritten on upgrade).
  6. okhello

    okhello Member

    Thanks! Changing "Navigation Tab Position" option to "End" achieved the result I wanted (y)
  7. drastic

    drastic Well-Known Member

    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.
  8. drastic

    drastic Well-Known Member

    any suggestion on how to hide the media nav tab?
  9. batpool52!

    batpool52! Well-Known Member

    Add this
    to Extra.CSS and it would hide the tab.
  10. drastic

    drastic Well-Known Member

    That's fine with me! Thanks @batpool52!

    edit: didn't work. :]
  11. batpool52!

    batpool52! Well-Known Member

    .navTabs .navTab.xengallery .navLink
        display: none;
    viper357 likes this.
  12. drastic

    drastic Well-Known Member

  13. TheLaw

    TheLaw Well-Known Member

    Note - this may not hide what appears in the responsive menu. It didn't for me.

Share This Page