Custom Tabs

Custom Tabs 1.6.3

No permission to download
@Ludachris, try this code (replace the uriMatch method):
PHP:
public static function uriMatch($uri)
    {
        $requestPaths  = XenForo_Application::get('requestPaths');
        $requestUri    = $requestPaths['requestUri'];
        $fullUri       = $requestPaths['fullUri'];
        $noBasePathUri = substr($requestUri, strlen($requestPaths['basePath']), strlen($requestUri));

        if ($uri == $requestUri
            || $uri == $fullUri
            || $uri == $noBasePathUri
            || preg_match('/[?&]/', $noBasePathUri) && preg_match('@^/?' . preg_quote($uri) . '@', $noBasePathUri))

        {
            return true;

        }
    }
This will work with routes, not full URLs.
That didn't seem to work either. If I create a child tab for each filtering option the tab will stay selected because the URL matches. But that isn't ideal, as there will eventually be a LOT of filtering options, and creating child tabs for all of them doesn't make sense.

Here's an example of a filtered URL that isn't working:
http://www.dsmtuners.com/timeslips/filter?transmission_type=Automatic&case=timeslips
 
When this is showing in responsive mode, does the burger menu (or is it supposed to) display child items?

1515681480448.webp

Those menu items have chillden, which aren't displayed inside the burger menu.
 
The behavior is the same for native menu items, it doesn't show children when they are grouped like that.
 
Is there any way to create secondary navigation dropdowns?
i.e. when you click on secondary level tab, then open tertiary level links in dropdown.
 
Not with the current setup. It would require custom changes in order to do that. Unfortunately, I don't have the time to do play with it so I won't be able to help you with that feature.
 
I have problems with that

Main Tab:
Level0 => /forum/plan

Sub Tabs
Level1.1 => /forum/plan?w=1
Level1.2 => /forum/plan?w=2

Better would be
Main Tab:
Level0 => /forum/plan

Sub Tabs
Level1.1 => /forum/plan
Level1.2 => /forum/plan?w=2

Anyway i have no second row (while some other tabs for /pages/{x} are ok)
The dropdown is not there for all three.

Probably there is a regex problem? But how i can change this to work, please?

While trying:
If i choose a known forum page, it is ok, the sub tabs are shown.
So what are the criterias for a tab url that is ok?
 
Last edited:
Now i change my addon to eat

/plan
/plan/0
/plan/1

now i have the tab active for all three urls, but still now submenu.

Next idea was to change the main tab, so there is no wrong regex

/plan/0
/plan/1
/plan/2

Now i have a drop down for /1 and /2 but not for /0

I tried dropdown only for main, only for seconds, for all, for none.
I cant have the subnavi. I cant have dropdown for all three pages.

Maybe there is somewthing wrong with my addon? I set

Code:
    public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) {
        $action = $router->resolveActionWithIntegerParam($routePath, $request, 'w');
        return $router->getRouteMatch('Who_Addon_ControllerPublic_File', $action, 'phrasename');
    }

    public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams) {
        return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'w');
    }

And anyway i cant make so many tabs like urls if i have w=$x;
is there an asterix possible to match the url to have the tab active?
 
Top Bottom