• 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?

Rob

Well-known member
#1
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 :)
 
S

Syndol

Guest
#2
Have you added your admin page to the Admin Navigation and Route Prefixes found under the Development tab?
 

Rob

Well-known member
#4
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.
 
S

Syndol

Guest
#5
I have just created a Test category with a Test Page under the Applications tab and it works for me.
 

Rob

Well-known member
#6
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');
    }
}
 
S

Syndol

Guest
#7
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');
 

Rob

Well-known member
#8
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!