neos-ui icon indicating copy to clipboard operation
neos-ui copied to clipboard

FEATURE: Add more options for filters

Open pKallert opened this issue 6 months ago • 1 comments

Description

When using the custom Filters options in the left sidebar I would sometimes like to filter by more than only nodeType. For example, filter by a certain folder and all of its subitems.

The use case would be: Reduce the amount of items in the main tree by moving parts of it into the filter function (everything below folder x moved to filter x). In this case this would be the folder for the footer menu.

We already had a discussion on that in https://github.com/neos/neos-ui/issues/1691 .

Suggested settings

In the discussion @grebaldi suggested three possible settings on how this could be achieved:

Option 1: Per-NodeType basis

baseNodeType: 'Neos.Demo:Document.LandingPage'
perNodeType:
  'Neos.Demo:Document.LandingPage':
     baseNodeType: 'Neos.Neos:Document' # show any document beneath landing pages

Option 2: Per-level basis

baseNodeType: 'Neos.Demo:Document.LandingPage'
perLevel:
  2:
     baseNodeType: 'Neos.Neos:Document' # starting at level 2, show any document 

Option 3: Super flexible

baseNodeType: 'Neos.Demo:Document.LandingPage'
rules:
   - condition: ${q(ancestors).filter('[instanceof Neos.Demo:Document.LandingPage]').get(0) != null && level > 2}
     baseNodeType: 'Neos.Neos:Document'

Any input/preferences here would be great!

pKallert avatar Aug 21 '24 10:08 pKallert