Expand my Community achievements bar.

SOLVED

Filters in AEM Collections

Avatar

Level 1

We need to add custom filters to the collections. Currently, the out-of-the-box (OOTB) options allow filtering by modified date and tags. We want to add a filter to segregate collections into categories such as private and public.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hi, thanks for the suggestion. I implemented it using ResourceChangeListener and added tags whenever a user creates a collection.

View solution in original post

3 Replies

Avatar

Administrator

@lukasz-m @pankajpr @Ravi_Joshi @AsifChowdhury would you please take a moment to review this question? We would be grateful if you could share your suggestion on this question.



Kautuk Sahni

Avatar

Community Advisor

Hi @GokulakannanV,

I think what would you like to achieve would be very difficult, or will break some fundamental rules in AEM. Let me explain the complexity below.

  1. Unlike Asset search or Lanches etc filters set for Collection view is not included in Search Forms, which would allow you to extend/modify filter set in very easy way.
  2. In theory you could try to modify Collection search filters programmatically, but this takes us into another limitation. Configuration for Collection view can be found under /libs/settings/dam/search/collections/jcr:content/items, the problem is that this section is marked as granite:InternalArea, which means you should not overlay this area. Or you are doing it on your own risk.
    Screenshot 2024-11-20 at 18.43.31.png



  3. Last but not least, even if you will decide to overlay above section and extend OOTB set of filters, this could be also a challenging exercise. It's because private and public collections are not distinguish by property but by path, so build a proper query that will limit the results will be difficult.
    collections-strucutre.jpg

Having above knowledge, and keeping in mind what is available OOTB, I would suggest below approach:

  1. Create two tags, one for public collection, and the other for private
  2. Use above tags to mark specific collection as public or private
  3. Use OOTB Tag filtering on search level.

Of course the solution is not ideal, and would requires some maintenance, but technically it is 100% OOTB solution. Which also have some additional benefits, like the fact you do not have to check this solution after AEM or SP upgrade.

Avatar

Correct answer by
Level 1

Hi, thanks for the suggestion. I implemented it using ResourceChangeListener and added tags whenever a user creates a collection.