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

How to ensure 'Applications' is the selected tab in my modification?

Discussion in 'XenForo Questions and Support' started by Rob, May 22, 2012.

  1. Rob

    Rob Well-Known Member

    How to ensure 'Applications' is the selected tab in my modification?

    I have a modification which exposes links in the Applications tab on the sidebar of the ACP.

    How do I make sure that the applications tab is selected when on my mods admin pages?

    I've been trying to hunt this down now for ages :)
     
  2. Syndol

    Syndol Guest

    Have you added your admin page to the Admin Navigation and Route Prefixes found under the Development tab?
     
  3. Rob

    Rob Well-Known Member

    Yes I have. All is working except no tab is selected on my mods pages
     
  4. Rob

    Rob Well-Known Member

    This is REALLY doing my head in now!

    I've made 'directory' a main navigation tab. The route matches fine and calls up an Index action... it all appears as it should... clicking the tab is routed ok and the Index's response template is rendered... except the directory tab is not highlighted and the left navigation doesnt show children (it just shows all 'home' navigation).

    I am very confused.
     
  5. Syndol

    Syndol Guest

    I have just created a Test category with a Test Page under the Applications tab and it works for me.
     
  6. Rob

    Rob Well-Known Member

    Hmmm... any ideas then?

    Could the error be in my router?
    Code:
    <?php
     
    class Directory_Route_PrefixAdmin_Directory implements XenForo_Route_Interface
    {
        public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
        {
            $action = $router->resolveActionWithIntegerParam($routePath, $request, 'id');
            return $router->getRouteMatch('Directory_ControllerAdmin_Directory', $action, 'Index');
        }
        
        public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
        {
            return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'id', 'name');
        }
    }
     
  7. Syndol

    Syndol Guest

    I do believe the 'Index' should be the value you gave Admin Navigation ID of the category
    return $router->getRouteMatch('Directory_ControllerAdmin_Directory', $action, 'Index');
     
    Jake Bunce likes this.
  8. Rob

    Rob Well-Known Member

    Lol, I was thinking that parameter was to specify a 'default' action should none be given in the url but that would obviously be Index in every case. #blondeMoment

    *fixed!

    Thanks!
     
    Syndol likes this.

Share This Page