• 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

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

Mike

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

AndyB

Well-known member
#4
I want to remove the resources tab completely. I have no use for the tab itself in the manner I am using the software.
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'
			//);
		}
	}
 
#7
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?
 

AndyB

Well-known member
#8
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?
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
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?
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.
 
#16
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?
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?
 

Brogan

XenForo moderator
Staff member
#20
You have edited the file incorrectly.

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