Joomla 3.8 // New Router & Nested View

by Sven Bluege   Last Updated November 21, 2017 16:10 PM

I want to use the new router classes to implement SEF stuff. I still struggle to get it to work.

I have a view which can show categories. So this view is called categories. If you click a category, you see the categories view again. Despite the name of the view and that there is just one view, this is similar to what com_content is doing with the category view.

Here is my code for the router constructor:

$categories = new JComponentRouterViewconfiguration('categories');
$categories->setKey('catid');
$categories->setNestable();
$this->registerView($categories);

That gives me an endless loop if I try to build routes for the categories view.

The class Joomla\CMS\Component\Router\RouterView\StandardRules seems to cause the issue here. Since my view has no parent, it can't have children. So the for(i=0;i<.....) in line 237 the i variable is counted and down endlessly.

        else
        {
            $i--;
            $found2 = false;
        }

        if (count($views[$view]->children))
        {
            $found = true;
        }

I'm pretty sure the standard Joomla code supports a single nested view. But how? I'm very thankful for a little hint.

Tags : joomla3.8


Related Questions






Team & Project Collaboration in Joomla

Updated October 19, 2017 06:10 AM