Expand my Community achievements bar.

SOLVED

read cq:styleIds for a component

Avatar

Level 7

Hi 

 

I have design policy in place to use pain brush style selection on component edit bar.

I see selected styles are stored as below

2023-02-10_8-45-53.png

 

I have a need to read these styles and render in sightly html.

for example: size 'mini' 'normal 'jumbo' for a button. If author selects style as 'mini', I would need to read it and render it in html sightly file size='mini' for webcomponents rendition.

 

Thanks for help.

 

-Sree

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,This will give you the css class name, if thats what you want yes, you can use this.



Arun Patidar

View solution in original post

4 Replies

Avatar

Community Advisor

Hi,

I think I have a sample code for this, someone asked the same question in community before

The below code is created as a concept

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/HelloWorldModel.java 



Arun Patidar

Avatar

Level 7

Thanks @arunpatidar I was looking at https://github.com/adobe/aem-core-wcm-components/blob/277b972c11a9d73d397e886aad0fe817294d2d08/bundl...

 

Is this some thing can be used ?  I am not sure what does this "ComponentStyleInfo" does , not  able to find source code.

 

 

Avatar

Correct answer by
Community Advisor

Hi,This will give you the css class name, if thats what you want yes, you can use this.



Arun Patidar