Finding the unused components/templates from a legacy CQ project | Community
Skip to main content
jond1978
New Participant
October 16, 2015
Solved

Finding the unused components/templates from a legacy CQ project

  • October 16, 2015
  • 4 replies
  • 1819 views

Hi All,

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

Jon

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 Lokesh_Shivalingaiah

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 replies

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
New Participant
October 16, 2015

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

edubey
New Participant
October 16, 2015

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

jond1978
jond1978Author
New Participant
October 16, 2015

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

Lokesh_Shivalingaiah
New Participant
October 16, 2015

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