read cq:styleIds for a component | Adobe Higher Education
Skip to main content
sreenu539
Level 7
February 10, 2023
Beantwoord

read cq:styleIds for a component

  • February 10, 2023
  • 2 reacties
  • 3265 Bekeken

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

Er kunnen geen reacties meer worden geplaatst op dit onderwerp.
Beste antwoord door arunpatidar

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

2 reacties

SantoshSai
Community Advisor
Community Advisor
February 10, 2023
arunpatidar
Community Advisor
Community Advisor
February 11, 2023

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
sreenu539
sreenu539Auteur
Level 7
February 13, 2023

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.

 

 

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAntwoord
Community Advisor
February 14, 2023

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

Arun Patidar