Cant figure out how to make an admin navigation...

Jaxel

Well-known member
So I created a tree of admin navigations on my forums...

But when I click on the tab, instead of listing the subnav on the navigation pane, it lists the default home navigation. However, its not actually on the home page, as it does properly print out the content of the page it's supposed to be on. Its only the navigation pane that is wrong. I do have an admin route prefix set up.

Anyone know what I'm doing wrong?
 
Just like in a front-end page, the "major section" in a RouteMatch object determines which tab (and the navigation panel) should be selected.

PHP:
// 'myCustomNav' should be your "Admin Navigation ID"
return $router->getRouteMatch('Foo_ControllerAdmin_Bar', $action, 'myCustomNav');
 
  • Like
Reactions: Sim
Just like in a front-end page, the "major section" in a RouteMatch object determines which tab (and the navigation panel) should be selected.
Yes, I'm aware... I said in my first post that I have a route prefix already set up...
Code:
<?php

class EWRtools_Route_Tools implements XenForo_Route_Interface
{
	public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
	{
		return $router->getRouteMatch('EWRtools_ControllerAdmin_Tools', $routePath, 'ewr');
	}
}

If you look at this screenshot you can see that the route is being handled correctly. It is properly sending it to the correct page. However, the navigation tab is not selected (should be 8WR Tools) and my navigation panel is clearly the home panel instead of my custom panel...
1.webp
 
Does changing the major section ('ewr') to something like 'tools', or 'users' change your selected tab?
 
Might be a problem with the custom navigation, then.
Could you please screenshot these two navigation pages from the development tab...
  • The "Admin Navigation" tree for your custom navigation menu (8WR Tools)
  • The "Edit Admin Navigation" page for the root menu (8WR Tools)
 
Ah... I figured it out...

For some reason the route needs to be said to the Admin Navigation ID, instead of the actual route prefix. This is at odds to how public navigation routing works in which you use the route prefix. Once I changed 'ewr' to 'EWRtools', it worked.

Thanks.
 
Top Bottom