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

Add links to navigation submenu (lost after 1.1.3 upgrade)

maxwolfie

Active member
#1
Hi all,

I have a mod called XenStaff installed however I lost the submenu links to the "Staff Page" (which I have set up as a Guild Member page) when I upgraded to XF 1.1.3 and my Flexile Dark style.

See the attached file, I've added in the "Diablo 3 Chapter Members", "Path of Exile Chapter Members" and "Torchlight 2 Chapter Members" where the old list used to be.

Any ideas?

EDIT: I have noticed that clicking "Guild Members" now reloads the whole page, I think before it just loaded the below content?

EDIT2: Ok, it works if I enable the Post Event Listener for XenStaff in the Development section (in Debug mode). However, as soon as I turn it off, the Guild Members main link disappears, and so does the secondary links.

Basically, I want Forum Members and Guild Members to be under "Members", and when you click on Guild Members, it will show the various Guilds as per my attached picture.
 

Attachments

Jake Bunce

XenForo moderator
Staff member
#2
Can I get your forum URL? It would help me to be able to see the pages involved.

Basically, I want Forum Members and Guild Members to be under "Members", and when you click on Guild Members, it will show the various Guilds as per my attached picture.
Do you mean you want to consolidate two different tabs?
 

maxwolfie

Active member
#3
www.HackSlashRepeat.com

I don't want Guild Members on the main menu, I want it nested under Members (which I can do), however, to hide Guild Members the only way I know how is to go into debug mode and uncheck the Code Event Listener for that navigation tab. But when I do this, the secondary links (see my pic above) disappear.

At the moment the site is just standard, i.e. Guild Members with no nesting (until I figure it out).
 

Jake Bunce

XenForo moderator
Staff member
#4
You can hide it with CSS:

Admin CP -> Appearance -> Templates -> EXTRA.css

Add this code:

Code:
.navTab.xfx_staff
{
	display: none;
}
But there is a Flexile bug that needs be fixed on your style first. Edit this template:

Admin CP -> Appearance -> Templates -> navigation

There is an instance of $extraTabId that needs to be replaced with {$extraTabId}. Once that is fixed then the above CSS should work to hide the Guild Members tab.

But the "members" tab will not become selected on the XenStaff pages because they are still assigned to the now hidden tab which means the secondary links (which are bound to the selected tab) will be empty when you visit those pages. You have two options to address this:

1) Edit this file:

library/XenStaff/Route/Prefix/Index.php

Change xfx_staff to members:

Code:
<?php

	class XenStaff_Route_Prefix_Index implements XenForo_Route_Interface
	{

		public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
		{

			return $router->getRouteMatch('XenStaff_ControllerPublic_Index', $routePath, 'xfx_staff');

		}

	}
You will still have to manually add the secondary links to the members tab by editing the navigation template.

2) Or use the Nodes As Tabs addon as described in this recent update (#3):

http://xenforo.com/community/resources/nodes-as-tabs.9/update?update=1441

This is an advanced application of the Nodes As Tabs addon, but it should work well in this instance, and it has the advantage of not requiring file edits. You will still have to manually add the secondary links to the members tab by editing the navigation template.
 

maxwolfie

Active member
#5
Cheers Jake, both options seem to require me to "manually add the secondary links to the members tab by editing the navigation template", of which I am not sure how to do! :)
 
#7
may I add a follow up question about this?
I'm also using the XenStaff addon to replace the member tab with my prefered user groups. Works great, but when after listing the members I click on a member, I loose my secondary navigation bar.
I understand this, as I'm using the HideMemberTab addon to hide the original member-tab, while the XenStaff pages are still linking to member profiles.

Is there a way to fix this?
member_prob1.jpg
member_prob2.jpg
 

Jake Bunce

XenForo moderator
Staff member
#8
may I add a follow up question about this?
I'm also using the XenStaff addon to replace the member tab with my prefered user groups. Works great, but when after listing the members I click on a member, I loose my secondary navigation bar.
I understand this, as I'm using the HideMemberTab addon to hide the original member-tab, while the XenStaff pages are still linking to member profiles.

Is there a way to fix this?
View attachment 32601
View attachment 32602
The "XenStaff" tab will not become selected on profile pages because they are still assigned to the now hidden "Members" tab which means the secondary links (which are bound to the selected tab) will be empty when you visit those pages. You have two options to address this:

1) Edit this file:

library/XenForo/Route/Prefix/Members.php

Change members to xfx_staff:

Code:
<?php

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');
	}
2) Or use the Nodes As Tabs addon as described in this recent update (#3):

http://xenforo.com/community/resources/nodes-as-tabs.9/update?update=1441

This is an advanced application of the Nodes As Tabs addon, but it should work well in this instance, and it has the advantage of not requiring file edits.
 
#9
Hi Jake,

thanks for your thoughts.
I very much prefer the second way of using the Nodes as Tabs addon (ofcourse). But I can't get it to work exactly as I want.

What I did was create a new Node (Link Forum) that links to "members/" and assigned that tab to the XenStaff tab-id. I also checked the box for assigning link forums to tabs. That solved the problem of not having a secondary bar, it now displays a clean bar under the primary navigation - okay so far.

But....

1. when I originally tick the XenStaff tab, I get a secondary bar with the different menu items - this is lost when using this, see attached screeny.

2. the breadcrumb shows "Home > Members (though nicely renamed) > Membername", where clicking on the Members part brings me....to the members page instead of the XenStaff page.

Solvable?
xenstaff_layout.jpg

For the record: your first suggestion works great, but I don't like doing manual code edits...
 

Jake Bunce

XenForo moderator
Staff member
#10
... and assigned that tab to the XenStaff tab-id.
The tabid should be xfx_staff

Also, make sure you didn't enable Display As Tab when editing the node. For a manual tab assignment like this you only need to enter the tabid. The other settings don't apply when you are doing a manual tab assignment.

If the problem persists then I can take a look if you give me access to your forum.
 
#11
Thanks, that is getting us close...
Now, the submenu works as expected, only the breadcrumb shows twice the same link.

xenstaff_layout2.jpg

The first one goes to the xenstaff page (correct), the second is going to the link-forum (members page) which I would like to hide.

Thanks again Jake, and sorry Greg for hijacking your thread ;)
 

Jake Bunce

XenForo moderator
Staff member
#12
I encountered that case in my own testing when I was adding this feature. That trailing breadcrumb is desirable in some situations but not in others, yet it didn't seem worth adding a configurable option for it. This is unique to link-forums with tab selection enabled.

You can edit this file (from the addon) to remove that trailing breadcrumb:

library/NodesAsTabs/Listen.php

Change the true to false:

Code:
	public static function breadCrumbs($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
	{
		if ($templateName == 'PAGE_CONTAINER'
		AND $nodeTabId = $template->getParam('nodeTabId')
		)
		{
			$navigation = array();
			$origNavigation = $template->getParam('navigation');
			$origNavigation = ($origNavigation ? $origNavigation : array());

			/* LINK FORUM TAB SELECTION */
			if (self::$linkForum['nodeRecord'])
			{
				// REMOVE INTERMEDIATE NODE CRUMBS IF LINK-FORUM IS LINKING TO ANOTHER NODE
				foreach ($origNavigation AS $key => $crumb)
				{
					if (!empty($crumb['node_id']))
					{
						unset($origNavigation[$key]);
					}
				}

				$nodeModel = XenForo_Model::create('XenForo_Model_Node');

				$navigation = array_merge(
					$nodeModel->getNodeBreadCrumbs(self::$linkForum['nodeRecord'], true),
					$origNavigation
				);
			}
			else
			{
				$navigation = $origNavigation;
			}