Define Filter-Tree-Depth

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
tomrose
Posts: 4
Joined: 23 Nov 2021, 10:32

Define Filter-Tree-Depth

Post by tomrose » 07 Dec 2021, 11:57

I would like to define the tree depth of
client/html/catalog/filter/tree/
so that by default no children will be returned.

Is there a way, like e.g. depth or deep or s.th. like this?

Thanks.

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Define Filter-Tree-Depth

Post by aimeos » 07 Dec 2021, 13:01

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

tomrose
Posts: 4
Joined: 23 Nov 2021, 10:32

Re: Define Filter-Tree-Depth

Post by tomrose » 16 Dec 2021, 08:53

Thank you.

In earlier versions, the default behaviour was:
Show main categories only, if no f_catid is given.
In version 2021, the whole tree is shown, not only the main categories.

In the file
/aimeos/ai-client-html/client/html/src/Client/Html/Catalog/Filter/Tree/Standard.php
the lines 257 + 258 read

Code: Select all

$catItems = map();
$catIds = [];
I would like to have the old behaviour:

Code: Select all

$catItems = $cntl->getTree( \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE )->toList(); 
$catIds = $catItems->keys()->toArray(); 
How can I achieve this?

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Define Filter-Tree-Depth

Post by aimeos » 17 Dec 2021, 09:46

Yes, thats because the value for the "Levels always" setting in the flexform of the catalog filter plugin. You should remove the value to get the old behavior.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

tomrose
Posts: 4
Joined: 23 Nov 2021, 10:32

Re: Define Filter-Tree-Depth

Post by tomrose » 17 Dec 2021, 10:23

Thank you.

I have inserted

Code: Select all

    'frontend' => [
        'catalog' => [
            'levels-always' => null,
        ],
    ],
    
in the file DistributionPackages/template/Resources/Private/Config/controller.php

The resulting behaviour is:
On the main catalogue-page all subcategories are shown, on a subcategory, only this subcategory is shown.
The second part is okay, but I want the subcategory only on a subcategory, not on the main starting catalogue-page.

Post Reply