Is it possible to create a list component that evaluates multiple paths and tags?

Avatar

Avatar

james-eaton

Avatar

james-eaton

james-eaton

20-10-2020

We have received a development request to build a component that evaluates assets in the following way:

 

DAM path A OR DAM path B

AND

Tags X, Y, AND Z

 

So that whenever the tags are found on an asset in either of the path locations, the asset will appear in the list.

Is it possible to have a list component behave in this way?

component list path tags

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Shashi_Mulugu

MVP

Avatar

Shashi_Mulugu

MVP

Shashi_Mulugu
MVP

20-10-2020

Yes @james-eaton we can create a component with the said requirements.

 

Basically its an and condition between tags field and path field(which has or condition in between)

 

Can be achieved using query builder.

Answers (1)

Answers (1)

Avatar

Avatar

Manjunath_K

Avatar

Manjunath_K

Manjunath_K

20-10-2020

Hi @james-eaton 

We can fetch the matching asset using Query Builder as mentioned below (example where Product A asset is tagged with product id "product-1331" , Product B is tagged with product id "product-1221" & both assets are under different root path). you can change OR & AND condition between tags based on your requirement.

 

Query Builder Result :

asset.PNG

 

Query :

property=cq:tags
property.1_value=test:product-1331
property.2_value=test:product-1221
property.or=true
group.1_path=/content/dam/test
group.2_path=/content/dam/images
group.p.or=true

 

 

Hope this helps!