Expand my Community achievements bar.

SOLVED

Preselect Style System

Avatar

Level 6

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @AEMWizard,

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
    cq-template-text.jpg
  • style system definition
    style-definition.jpg
    styles-gui.png

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @AEMWizard,

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
    cq-template-text.jpg
  • style system definition
    style-definition.jpg
    styles-gui.png

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.