Preselect Style System | Community
Skip to main content
New Participant
April 14, 2023
Solved

Preselect Style System

  • April 14, 2023
  • 1 reply
  • 968 views

Is there a way for me to pre-select style system from my aem components via editable templates? I am not able to do this.

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
lukasz-mAccepted solution
New Participant
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.