Expand my Community achievements bar.

SOLVED

OOTB Sling selectors | AEM

Avatar

Level 5

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @NehaCMS ,

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.

View solution in original post

5 Replies

Avatar

Employee Advisor

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.

Avatar

Correct answer by
Community Advisor

Hi @NehaCMS ,

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.