Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

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

AEM LinksLinkedIn

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @sreenu539,

 

Similar question answered here: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/accessing-component-style-...

Hope that helps!

Regards,

Santosh

 


Santosh Sai

AEM BlogsLinkedIn


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

AEM LinksLinkedIn

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

AEM LinksLinkedIn