Preselect Style System | Community
Skip to main content
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 lukasz-m

Hi @supportmember,

I am afraid this is not possible to be achieved using editable templates. What you can configure there, is only set of default classes for given component that will be added in case no other style is selected.

However you can utilize other AEM OOTB mechanism. This can be done using cq:template for component. In this approach you can define which style(s) will be applied automatically. On content level styles selected form style system are stored as part of cq:styleIds property. Below is an example for we retail Text component.

  • cq:template definition
  • style system definition

As you can see there are 2 styles available and base on style id configured in cq:template style representing red color class will be applied by default, when author adds component into page.

1 reply

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
April 16, 2023

Hi @supportmember,

I am afraid this is not possible to be achieved using editable templates. What you can configure there, is only set of default classes for given component that will be added in case no other style is selected.

However you can utilize other AEM OOTB mechanism. This can be done using cq:template for component. In this approach you can define which style(s) will be applied automatically. On content level styles selected form style system are stored as part of cq:styleIds property. Below is an example for we retail Text component.

  • cq:template definition
  • style system definition

As you can see there are 2 styles available and base on style id configured in cq:template style representing red color class will be applied by default, when author adds component into page.