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

XF 1.3 Remove Resources Tab

Discussion in 'XenForo Questions and Support' started by iguanairs, Jun 18, 2014.

  1. iguanairs

    iguanairs Member

    I want to remove the resources tab completely. I have no use for the tab itself in the manner I am using the software. I ran some searches on this site and on google but came up empty. This shouldn't be difficult but it is eluding me. (I went through templates looking as well.)
     
  2. Mike

    Mike XenForo Developer Staff Member

    The tab is added programmatically. You can detect it in the $extraTabs.middle variable in the navigation template. I'd probably just look at hiding it with CSS, though that may trigger other oddities.
     
  3. iguanairs

    iguanairs Member

    I attempted to do that with the following css:

    .navTabs .navTab.resources.PopupClosed { display: none }

    That didn't work though. My opinion on this is that there should be nothing that is hard coded programatically like this.
     
  4. AndyB

    AndyB Well-Known Member

    Edit the following file:

    library/XenResources/Listener/Template.php

    (default code)
    PHP:
        public static function navigationTabs(&$extraTabs$selectedTabId)
        {
            if (
    XenForo_Visitor::getInstance()->hasPermission('resource''view'))
            {
                
    $extraTabs['resources'] = array(
                    
    'title' => new XenForo_Phrase('resources'),
                    
    'href' => XenForo_Link::buildPublicLink('full:resources'),
                    
    'position' => 'middle',
                    
    'linksTemplate' => 'resources_tab_links'
                
    );
            }
        }
    (edited code)
    PHP:
        public static function navigationTabs(&$extraTabs$selectedTabId)
        {
            if (
    XenForo_Visitor::getInstance()->hasPermission('resource''view'))
            {
                
    //$extraTabs['resources'] = array(
                    //'title' => new XenForo_Phrase('resources'),
                    //'href' => XenForo_Link::buildPublicLink('full:resources'),
                    //'position' => 'middle',
                    //'linksTemplate' => 'resources_tab_links'
                //);
            
    }
        }
     
    GamersChat likes this.
  5. iguanairs

    iguanairs Member

    Thank you Andy!
     
  6. Jeremy P

    Jeremy P Well-Known Member

    HTML:
    .navTabs .publicTabs .navTab.resources {
        display: none;
    }
    
    works fine for me..?
     
  7. GlaswegianGamer

    GlaswegianGamer New Member

    I apologise for bumping an old thread, but I just done what @AndyB wrote and all it done was remove the resources tab from the navbar. If someone knows the URL, they can still access the resources section, can't they not?
     
  8. AndyB

    AndyB Well-Known Member

    Correct, the template edit will only remove the tab from the navbar and direct URL access is still possible.

    I assume you only want to allow access to the Resources Manager to certain user groups and want to prevent direct access to those not in the authorized user group?
     
  9. GlaswegianGamer

    GlaswegianGamer New Member

    I'd rather remove the whole resources section entirely from all groups (and if possible, the forum (even the URL ) if possible) as it will never be used.
     
  10. rainmotorsports

    rainmotorsports Well-Known Member

    Are you using anything that is a part of the resource manager? If not then why not just disable or uninstall the addon.
     
    GlaswegianGamer likes this.
  11. GlaswegianGamer

    GlaswegianGamer New Member

    Oh, I mis-understood what that addon was... I thought it was to monitor how much resources Xenforo was using..:rolleyes: Thanks for telling me about that!
     
  12. rainmotorsports

    rainmotorsports Well-Known Member

    If you don't want it at all you can just uninstall it. But a simple unchecking in the admin control panel will make it disappear temporarily.
     
    GlaswegianGamer likes this.
  13. GlaswegianGamer

    GlaswegianGamer New Member

    Yeah, have just done that now. Thanks again.

    Also thanks to @AndyB for the code to remove the resources tab. :)
     
  14. Martok

    Martok Well-Known Member

    Seems an odd thing to have purchased the Resources Manager and then not want to use it...
     
  15. iguanairs

    iguanairs Member

    I was thinking the same thing Martok.
     
  16. Mart

    Mart Member

    Yes, this seems overly hacky to take control of. Even just hiding the tab from, say, unregistered users, requires CSS and template modifications. Has anyone found a nice way of doing it?
     
  17. Mike

    Mike XenForo Developer Staff Member

    The tab is permission controlled already. This thread was related to removing it despite having permission.
     
    Mart likes this.
  18. Mart

    Mart Member

    Thank you for the correction! I feel a fool.
     
  19. anvar

    anvar Member

    almost.... !!!, im sorry already fixed.
     
    Last edited: Nov 15, 2014
  20. Brogan

    Brogan XenForo Moderator Staff Member

    You have edited the file incorrectly.

    I would never recommend editing files in this manner as any changes will be overwritten when you upgrade.
     

Share This Page