コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

Finding the unused components/templates from a legacy CQ project

Avatar

Level 2

Hi All,

is there an effective way to identify unused components/templates from a legacy CQ project.

Jon

1 受け入れられたソリューション

Avatar

正解者
Level 10

You can write a query using sling:resourceType in the path '/content/<project> for the component / templates you are looking for. If it returns '0', then it will not be used

元の投稿で解決策を見る

4 返信

Avatar

正解者
Level 10

You can write a query using sling:resourceType in the path '/content/<project> for the component / templates you are looking for. If it returns '0', then it will not be used

Avatar

Level 10

As @bsloki mentioned write a simple query in your aem @ http://localhost:4502//libs/cq/search/content/querydebug.html

Here is one sample query:

path=/content/blog type=cq:PageContent property=cq:template property.value=/apps/blog/templates/homepage

If you need help, refer to query builder documentation @ https://docs.adobe.com/docs/en/cq/5-6-1/dam/customizing_and_extendingcq5dam/query_builder.html

Avatar

Level 2

bsloki wrote...

You can write a query using sling:resourceType in the path '/content/<project> for the component / templates you are looking for. If it returns '0', then it will not be used

 

Is there a way to list out all used/unused templates from the content folder? This would help us to search with templates names one by one.

Thanks in advance

Avatar

Level 10

There is nothing OOB, you will have to write your own custom query for this.

ex: See if you can use some joins or you can fetch all the templates and loop through the same query for each template