Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

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

Avatar

Level 3

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?

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Yes @james-mke 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.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Yes @james-mke 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.

Avatar

Level 8

Hi @james-mke 

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!