OOTB Sling selectors | AEM | Community
Skip to main content
Level 4
May 30, 2024
Solved

OOTB Sling selectors | AEM

  • May 30, 2024
  • 2 replies
  • 1368 views

Hi team,

 

Looking for list of OOTB selectors which comes by default in AEM  that are used by Sling to determine how resource is rendered so that we know we are not mistakenly allowing or using any OOTB selector in our code base that can trigger some internal implementations.

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 HrishikeshKagne

Hi @nehama ,

In AEM, there are several OOTB selectors that are used by Sling to determine how a resource is rendered. These selectors are typically used to modify the behavior or output of a resource. Here are some of the commonly used OOTB selectors in AEM:

1. `.html`: This selector is used to render the resource as HTML. It is the default selector used by Sling if no other selector is specified.

2. `.json`: This selector is used to render the resource as JSON. It returns the resource data in JSON format.

3. `.feed`: This selector is used to render the resource as a feed, such as an RSS or Atom feed.

4. `.print`: This selector is used to render a printer-friendly version of the resource.

5. `.tidy`: This selector is used to render the resource with additional formatting or cleanup applied.

6. `.infinity`: This selector is used to enable pagination for a resource, allowing the retrieval of a subset of the resource's content.

7. `.nopage`: This selector is used to exclude the resource from being included in a page.

8. `.txt`: This selector is used to render the resource as plain text.

These are some of the commonly used OOTB selectors in AEM. It's important to note that these selectors are part of the default behavior of Sling and are generally safe to use. However, it's always a good practice to review and validate the selectors used in your codebase to ensure they align with your specific requirements and do not conflict with any internal implementations.

2 replies

joerghoh
Adobe Employee
Adobe Employee
May 30, 2024

I don't think that there is a comprehensive list of it. But you can try it out every selector before you choose to implement one on your own.

NehaMaAuthor
Level 4
May 31, 2024

Thanks @joerghoh 

HrishikeshKagne
Community Advisor
HrishikeshKagneCommunity AdvisorAccepted solution
Community Advisor
May 30, 2024

Hi @nehama ,

In AEM, there are several OOTB selectors that are used by Sling to determine how a resource is rendered. These selectors are typically used to modify the behavior or output of a resource. Here are some of the commonly used OOTB selectors in AEM:

1. `.html`: This selector is used to render the resource as HTML. It is the default selector used by Sling if no other selector is specified.

2. `.json`: This selector is used to render the resource as JSON. It returns the resource data in JSON format.

3. `.feed`: This selector is used to render the resource as a feed, such as an RSS or Atom feed.

4. `.print`: This selector is used to render a printer-friendly version of the resource.

5. `.tidy`: This selector is used to render the resource with additional formatting or cleanup applied.

6. `.infinity`: This selector is used to enable pagination for a resource, allowing the retrieval of a subset of the resource's content.

7. `.nopage`: This selector is used to exclude the resource from being included in a page.

8. `.txt`: This selector is used to render the resource as plain text.

These are some of the commonly used OOTB selectors in AEM. It's important to note that these selectors are part of the default behavior of Sling and are generally safe to use. However, it's always a good practice to review and validate the selectors used in your codebase to ensure they align with your specific requirements and do not conflict with any internal implementations.

Hrishikesh Kagane
NehaMaAuthor
Level 4
May 31, 2024
Level 4
May 31, 2024

Hi @nehama ,

Please mark correct solution for posterity.

Thanks!