Reg: Component Context getcssclassname

Avatar

Avatar

Shashi_Mulugu

MVP

Avatar

Shashi_Mulugu

MVP

Shashi_Mulugu
MVP

05-04-2021

Hello @dgordon86 ,

 

I just read your reply on https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/don-t-understand-cssclassn... question on what is the use of getcssclassname but i have requirement where i only need Styles added via Style System nothing else..like page component or content component names. Is there any way?

 

@Jörg_Hoh @kaushal_mall 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

883

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

883
Arun_Patidar
MVP

06-04-2021

Hi,

you can use API to access the style system

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/co...

 

but the https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/co...() will return the classes which is either included by default or using cq:htmlTag

cq:htmlTag node : This node can be added under a component and can have the following properties:

  • cq:tagName {String} : This can be used to specify a custom HTML tag to be used for wrapping the components instead of the default DIV element.
  • class {String} : This can be used to specify css class names to be added to the wrapper.

Answers (2)

Answers (2)

Avatar

Avatar

Shashi_Mulugu

MVP

Avatar

Shashi_Mulugu

MVP

Shashi_Mulugu
MVP

07-04-2021

Correct answer in comments

Avatar

Avatar

rush_pawan

Avatar

rush_pawan

rush_pawan

06-04-2021

also, just to add an idea and not doing framework layer customization(if it is not need global level for many instances)

 

why not to use componentContext or includoption to disable the tag (div/span etc...) decoration only in publish/disabled mode and read the styles using contentpolicystyle and generate desired div/span container with style class (only in publish/disable mode) inside component only (as top container).

 

other way around to look at it.

 

thanks!!