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

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

Discussion in 'XenForo Development Discussions' started by Jaxel, Dec 29, 2010.

  1. Jaxel

    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?
  2. Shadab

    Shadab Well-Known Member

    Just like in a front-end page, the "major section" in a RouteMatch object determines which tab (and the navigation panel) should be selected.

    // 'myCustomNav' should be your "Admin Navigation ID"
    return $router->getRouteMatch('Foo_ControllerAdmin_Bar'$action'myCustomNav');
    Sim likes this.
  3. Jaxel

    Jaxel Well-Known Member

    Yes, I'm aware... I said in my first post that I have a route prefix already set up...
    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...
  4. Shadab

    Shadab Well-Known Member

    Does changing the major section ('ewr') to something like 'tools', or 'users' change your selected tab?
  5. Jaxel

    Jaxel Well-Known Member

    Yeah... if I change it to "tools", it does properly select the tools tab.
  6. Shadab

    Shadab Well-Known Member

    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)
  7. Jaxel

    Jaxel Well-Known Member

    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.

    Sim and Sadik B like this.
  8. Shadab

    Shadab Well-Known Member

    From post #2:
    Sim and Jeremy like this.
  9. silence

    silence Well-Known Member


Share This Page