Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Query BUilder

Avatar

Level 6

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.

1 Accepted Solution

Avatar

Correct answer by
Level 6

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.

View solution in original post

3 Replies

Avatar

Community Advisor

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.



Arun Patidar

Avatar

Correct answer by
Level 6

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.

Avatar

Administrator

@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!  



Kautuk Sahni