Hey , is there a way that i can find the number of times a component as been used in the website? i want a number count of the most used components in the website . any easy way to do this?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Zendarkke ,
OOTB you can check the components page (eg:- http://localhost:4502/libs/wcm/core/content/sites/components.html) . Upon clicking on the required component it can show the list of pages where the component is used. That can give you an idea of the usage of the component. Groovy script or SQL query can be another way to get the exact count.
Thanks,
Somen
Hi There are couple of ways you can approach using querybuilder or using groovy scripts to find the list of components and occurrences.
If you want to do it using the query tool you will have to start with basic sql2 query as aggregations wont be supported and deduplicate and build your results .
SELECT [sling:resourceType] FROM [nt:unstructured]
WHERE ISDESCENDANTNODE([/content/www/XX/XX/test])
AND [sling:resourceType] IS NOT NULL
Also keep in mind the performance aspect and adjust the search nodes appropriately
Hi @Zendarkke ,
OOTB you can check the components page (eg:- http://localhost:4502/libs/wcm/core/content/sites/components.html) . Upon clicking on the required component it can show the list of pages where the component is used. That can give you an idea of the usage of the component. Groovy script or SQL query can be another way to get the exact count.
Thanks,
Somen
Just adding what @somen-sarkar and @sherinregi already suggested, if you are using ACS Common then use Component Report Builder
Hi @Zendarkke ,
Try query to get the count from pages.
Example :
SELECT COUNT(*)
FROM [nt:base] AS root
WHERE ISDEEP TRUE AND root.[jcr:primaryType] = 'nt:unstructured'
AND root.[jcr:content/@sling:resourceType] LIKE '/apps/%'
Thanks
Views
Likes
Replies
Views
Likes
Replies