Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How can you find all the pages in which an image is used?

Avatar

Level 2

Is there a way to find all the pages in which a particular image is used?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

You can find the references of an image by selecting image, clicking on properties and check under references tab

 

Screenshot 2023-03-14 at 9.49.22 AM.png

Refer https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/w... for retrieving it from backend

Screenshot 2023-03-14 at 9.52.34 AM.png

View solution in original post

4 Replies

Avatar

Community Advisor

Yes we do have.

From the asset console, you just select the image and select the references from the left rail.

 

if you need the reference in query, you can easily write one.

You can get the reference in code as well.

Hope this hleps.

Umesh Thakur

Avatar

Community Advisor

It can be seen in the left rail as mentioned by @Umesh_Thakur .

Other than that, you can hit the below query to get a list.

select * from nt:base where jcr:path like '{path_to_search}' and contains(*, '{image_path_to_search}')

Avatar

Correct answer by
Community Advisor

Hi,

 

You can find the references of an image by selecting image, clicking on properties and check under references tab

 

Screenshot 2023-03-14 at 9.49.22 AM.png

Refer https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/w... for retrieving it from backend

Screenshot 2023-03-14 at 9.52.34 AM.png

Avatar

Employee Advisor

Option 1: Select the specific asset and click on References tab, then you will be seeing all the pages in which that image is used.

 

Option 2: If you want to do it programmatically then you can refer http://wemcode.wemblog.com/get_asset_reference_in_page [Other way around section]

 

Hope these will help.