Hi Aem Community,
Is it best practice to run query builder under a page like path as page without .html, I need to find specific component of a page.
Thank You,
Keerthi K.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Keerthi0555 using the query builder to search for specific components within a page is a common practice. When making query, it is a best practice to use a path that points to the page's content node rather than including the .html extension. It ensures that the query targets the content structure rather than the rendered output.
Hi @Keerthi0555
It depends, if you have that component inside many roots or scattered then yes write a query otherwise you can simply just iterate a tree.
Hi @Keerthi0555 using the query builder to search for specific components within a page is a common practice. When making query, it is a best practice to use a path that points to the page's content node rather than including the .html extension. It ensures that the query targets the content structure rather than the rendered output.
@Keerthi0555 Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Hi @Keerthi0555,
Go to http://localhost:4502/libs/cq/search/content/querydebug.html
==============================
path → where you want to search (e.g., /content/your-site).
type = nt: unstructured → components are stored as NT: unstructured nodes.
property = sling:resourceType → identifies the component type.
property.value → the component’s full resourceType (e.g., your-site/components/content/your-component).
p.limit = -1 → return all matches (remove the default 10-item limit).
===============================
{
"path": "/content/your-site",
"type": "nt: unstructured",
"property": "sling:resourceType",
"property.value": "your-site/components/content/your-component",
"p.limit": -1
}
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies