read cq:styleIds for a component | Community
Skip to main content
sreenu539
Level 7
Feb 10, 2023 3:53 PM UTC
Solved

read cq:styleIds for a component

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

 

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Feb 14, 2023 7:50 AM UTC

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

Arun Patidar

4 replies

arunpatidar
New Participant
Feb 11, 2023 9:53 AM UTC

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 

Translate
Arun Patidar
sreenu539
sreenu539Author
Level 7
Feb 13, 2023 10:16 PM UTC

Thanks @arunpatidar I was looking at https://github.com/adobe/aem-core-wcm-components/blob/277b972c11a9d73d397e886aad0fe817294d2d08/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/util/AbstractComponentImpl.java#L159

 

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

 

 

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Feb 14, 2023 7:50 AM UTC

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

Translate
Arun Patidar
SantoshSai
New Participant
Feb 10, 2023 4:26 PM UTC
Santosh Sai