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

removing members tab

Discussion in 'Troubleshooting and Problems' started by secnam, May 2, 2011.

  1. secnam

    secnam Active Member

    can anyone let me know how i can remove the members tab from the top nav bar.

  2. Brogan

    Brogan XenForo Moderator Staff Member

    Edit the navigation template and remove the <!-- members --> section.

    It won't stop anyone accessing the members page though if they know the URL.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can remove the tab from the templates:

    Admin CP -> Appearance -> Templates -> navigation

    Remove this entire block of code:

    		<!-- members -->
    		<xen:if is="{$tabs.members}">
    			<li class="navTab members {xen:if $tabs.members.selected, 'selected', 'Popup PopupControl PopupClosed'}">
    				<a href="{$tabs.members.href}" class="navLink">{$tabs.members.title}</a>
    				<a href="{$tabs.members.href}" class="SplitCtrl" rel="Menu"></a>
    				<div class="{xen:if {$tabs.members.selected}, 'tabLinks', 'Menu JsOnly tabMenu'}">
    					<div class="primaryContent menuHeader">
    						<div class="muted">{xen:phrase quick_links}</div>
    					<ul class="secondaryContent blockLinksList">
    						<li><a href="{xen:link members}">{xen:phrase registered_members}</a></li>
    						<li><a href="{xen:link online}">{xen:phrase current_visitors}</a></li>
    						<li><a href="{xen:link recent-activity}">{xen:phrase recent_activity}</a></li>
    Note that this will affect profile pages which are bound to the members tab.

    edit - brogan! :p
    Breixo and Mike Law like this.
  4. secnam

    secnam Active Member

    thanks guys.
  5. Ryan Kent

    Ryan Kent Well-Known Member

    I am not clear on this last part. By removing the block of code mentioned above the link in the main navigation bar will be removed. If a member manually navigates to the page, or if they go to profile pages via their user card, how are they affected?
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    There will be no active tab on profile pages. All of the nav tabs will be inactive.
  7. Joe Link

    Joe Link Well-Known Member

    How can I remove the tab, but preserve the "Notable Members" "Current Visitors" and "Recent Activity" links if the page is navigated to via a link or direct url?

  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It would be necessary to assign those pages to a different tab. There isn't a good way to do this. The easiest way is to edit this file:


    Change the red piece to some other tabid:

    class XenForo_Route_Prefix_Members implements XenForo_Route_Interface
    	 * Match a specific route for an already matched prefix.
    	 * @see XenForo_Route_Interface::match()
    	public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
    		$action = $router->resolveActionWithIntegerParam($routePath, $request, 'user_id');
    		return $router->getRouteMatch('XenForo_ControllerPublic_Member', $action, 'members');
    	 * Method to build a link to the specified page/action with the provided
    	 * data and params.
    	 * @see XenForo_Route_BuilderInterface
    	public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
    		if (isset($extraParams['page']))
    			if (strval($extraParams['page']) !== XenForo_Application::$integerSentinel && $extraParams['page'] <= 1)
    		return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'user_id', 'username');
    Tab IDs of navigation tabs can be seen in the HTML source:

    <li class="navTab members Popup PopupControl PopupClosed">
    Or if you specify a tabid that doesn't exist then it will have the effect of not selecting any tab which is also acceptable.
    Coop1979 likes this.
  9. t0daY

    t0daY Member

    Sorry for jumping here in when this post is nearly 2 years old, but is it possible to assign a static page to the members tab? And displaying it as the first page when you are clicking on "Members"?
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Consider using this addon to create an entirely new tab (with the same name if you want):


    A page node can be used as a "static page".

Share This Page