Tuesday, 2 May 2017

Adding additional filter to DAM Search in AEM 6.2

Article summary 

Discuss how to add the additional filter to the DAM search in AEM 6.2. 

At the end of this article you should be able to see Language filter as below and should be able to filter assets based on the language selection.
















Note: I added only 2 languages. We can add as many languages as we need. 

Solution: 

In AEM 6.2 in order to update or add new functionality one need to edit the Search forms.

In this article I am going to add a new filter for the dam search, which will filter the assets based on the language property selected for the asset.

Below are the steps to be followed.

Creating language nodes:

Let’s first create the language nodes that will appear in the newly created language filter.
1.    Overlay the folder /libs/dam/options/predicates. Because this folder contains all other filter values.
2.    Under the /apps/dam/options/predicates, create a folder named languages of type sling:OrderedFolder”.
3.   Right click on languages and select Create, Create Node. Enter the following values:
Name: en_in
Type: nt:unstructured

4.    For the en_in node add the properties as below



5.    Create different languages nodes as in the screenshot.
6.    Save all.

Creating new filter using language nodes.

Now lets create the new filer for the DAM search rail.

1.     Go to Projects.html.
2.     Click on the Adobe Experience Manager on top left corner.
3.     Click on tools as below



4    Click on search forms.
5.     Select Assets Admin Search Rail and click edit.
6.     Drag and drop the options predicate from the select predicate tab


7.     Select the new options filed and enter the values as in below.
8.     Value of the “Property Name” filed should be set properly. In this case this should be “jcr:content/metadata/dc:language”. This is how the language vale will be saved for the asset in content/dam.
9.     For the option path browse to the earlier created languages folder under /apps/dam/options/predicates/languages and select the languages. 
10.     Click on plus sign after the selection.


11.     Double check if all the values entered are appropriate and say done.

12.     Once you click on Done, new content will be created under /conf/global/settings/dam/search/facets/assets. Here our new filter values will be saved.


That’s it. Done.!!
Now go to any asset. And update the asset with language property ands save.




Now open Assets.html
Click on Adobe experience manager, select assets, click on search icon on top right.
In the filter section expand on language option and select English(India), you should be able to see the filtered image as below.