How to create Search filter for Folder | Community
Skip to main content
Level 6
September 28, 2023

How to create Search filter for Folder

  • September 28, 2023
  • 1 reply
  • 1499 views

Suppose In my DAM I have two folder /content/dam/us/en and /content/dam/us/de I want to create option filter predicate for /content/dam/us/en which should not reflect on /content/dam/us/de DAM asset path

 

 


Question

 

1. Can we add filter predicate for just  /content/dam/us/en dam path?

2. Can we add filter different for  /content/dam/us/en and  /content/dam/us/de which should not reflect in one another?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

aanchal-sikka
Community Advisor
Community Advisor
September 28, 2023

Hello @ronnie09 

 

We do not seem to have a conditional show/hide option via Serach Forms UI.

Can you please try using renderconditions? Append them via CRXDE.

 

Caution: The render conditions might be deleted, if someone edits the Serach Form from UI

Aanchal Sikka
Ronnie09Author
Level 6
September 28, 2023

Hi @aanchal-sikka 

Do you have any sample how can I workout via renderconditions?

aanchal-sikka
Community Advisor
Community Advisor
September 28, 2023

@ronnie09 

 

 

{ "jcr:primaryType": "nt:unstructured", "listOrder": "101", "metaType": "tags", "fieldLabel": "Tags 1", "sling:resourceType": "cq/gui/components/coral/common/admin/customsearch/searchpredicates/tagspredicate", "granite:rendercondition": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "granite/ui/components/foundation/renderconditions/and", "dms7feature": { "jcr:primaryType": "nt:unstructured", "expression": "${!granite:containsIgnoreCase(header['Referer'], 'library')}", "sling:resourceType": "granite/ui/components/coral/foundation/renderconditions/simple" } } }

Please try above config

I have tried on Tabs predicate, the filter is not displayed, but its title is available.

The condition checks if the request is made from a folder that have 'library' in it.

 

When search is done from a folder, the request for filter section has Referer like :

 

Aanchal Sikka