className property for components | Community
Skip to main content
selvaganesh
New Participant
October 16, 2015
Solved

className property for components

  • October 16, 2015
  • 4 replies
  • 990 views

I saw a property called className in geometric outdoors component. What is its significance ?

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
New Participant
October 16, 2015

What component are you referring to? 

Lokesh_Shivalingaiah
New Participant
October 16, 2015

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

selvaganesh
New Participant
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
New Participant
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.