className property for components | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

This is what you are referring to - its a property that belongs to a node of type wcm/mobile/components/page.

[img]className.png[/img]

This is referencing CSS class. Its used in the JSP logic as well:

 String className = component.getProperties().get("className", "");

 pageContext.setAttribute("className", StringEscapeUtils.escapeHtml4(className));

Then used in the <body > tag for style. 

4 replies

smacdonald2008
Level 10
October 16, 2015

What component are you referring to? 

Lokesh_Shivalingaiah
Level 10
October 16, 2015

This is basically a property used to apply CSS style dynamically !!

selvaganesh
Level 5
October 16, 2015

There is a "page" and "page_mobile "component. That is the main template. 

For page component the className is "page"

For page_mobile component the className is "page-mobile"

Is it used for CSS ?

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

This is what you are referring to - its a property that belongs to a node of type wcm/mobile/components/page.

[img]className.png[/img]

This is referencing CSS class. Its used in the JSP logic as well:

 String className = component.getProperties().get("className", "");

 pageContext.setAttribute("className", StringEscapeUtils.escapeHtml4(className));

Then used in the <body > tag for style.