Identifying image use on other folders | Community
Skip to main content
May 17, 2022
Solved

Identifying image use on other folders

  • May 17, 2022
  • 4 replies
  • 1063 views

Image A is expiring and there are 20 different folders in AEM.

Before removing Image A, I will need to identify which of the 20 folders is associating with Image A.

 

How do I go about doing so?

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 lukasz-m

Hi @audrey27,

In case you have copy of the same image in multiple folders in the DAM, you can simply run query e.g from crx/de. Below is an example of query that will search for all the folders that contains image with specific name. You can easy change criteria from name to other property. The example query will look for all folders in entire DAM (/content/dam) that includes asset with name 48-hours-of-wilderness-1.jpg

SELECT * FROM [nt:folder] AS folder
INNER JOIN [dam:Asset] AS asset ON ISCHILDNODE(asset, folder)
WHERE ISDESCENDANTNODE(folder, "/content/dam")
AND name(asset) = "48-hours-of-wilderness-1.jpg"

However, if by folders associated with asset you mean collections, then you can get list of the collections that include reference to given asset under asset properties. Below is sample screen, it shows list of all references so pages and collections - you can easy recognize collection by its location.

4 replies

Himanshu_Jain
Community Advisor
Community Advisor
May 17, 2022

How you are associating 20 folders with image A?

You need to copy in each and every folder .

For pages you can check in properties reference tab it will display the list of pages where your image is in use.

 

Himanshu Jain
arunpatidar
Community Advisor
Community Advisor
May 17, 2022
DEBAL_DAS
New Member
May 17, 2022

Just curious to know, How are you associating multiple DAM folders with same image and what is the advantage of it?

Debal Das, Senior AEM Consultant
lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
May 17, 2022

Hi @audrey27,

In case you have copy of the same image in multiple folders in the DAM, you can simply run query e.g from crx/de. Below is an example of query that will search for all the folders that contains image with specific name. You can easy change criteria from name to other property. The example query will look for all folders in entire DAM (/content/dam) that includes asset with name 48-hours-of-wilderness-1.jpg

SELECT * FROM [nt:folder] AS folder
INNER JOIN [dam:Asset] AS asset ON ISCHILDNODE(asset, folder)
WHERE ISDESCENDANTNODE(folder, "/content/dam")
AND name(asset) = "48-hours-of-wilderness-1.jpg"

However, if by folders associated with asset you mean collections, then you can get list of the collections that include reference to given asset under asset properties. Below is sample screen, it shows list of all references so pages and collections - you can easy recognize collection by its location.