How can you find all the pages in which an image is used? | Community
Skip to main content
Level 2
March 14, 2023
Solved

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

  • March 14, 2023
  • 4 replies
  • 1606 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ravi_Pampana

Hi,

 

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

 

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

4 replies

Umesh_Thakur
Community Advisor
Community Advisor
March 14, 2023

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

Rohit_Utreja
Community Advisor
Community Advisor
March 14, 2023

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}')

Ravi_Pampana
Community Advisor
Ravi_PampanaCommunity AdvisorAccepted solution
Community Advisor
March 14, 2023

Hi,

 

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

 

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

DEBAL_DAS
New Member
March 15, 2023

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.

Debal Das, Senior AEM Consultant