I'm new to Kentico and am using version 9 for a website. A graphic designer asked me if I could create a macro or code that adds the page type of a page to the body tag as a css class. Has anyone done this before?
Asked
Active
Viewed 1,418 times
4 Answers
7
Following is a macro, that gives you page type info object:
{% DocumentContext.CurrentDocument.NodeClass #%}
Go to System -> Macros -> Console to see/try available macros.

Roman Hutnyk
- 1,549
- 9
- 14
5
<body class="{% CurrentDocument.NodeClass.ClassName.ToString() #%}">

Om prakash
- 37
- 5

Chetan Sharma
- 1,432
- 12
- 13
2
I use Kentico 8.2 version and I can get this using:
<body class="anotherClass {% ClassName #%}">...</body>
Maybe this work also in Kentico 9.
Hope this help!

Zan RAKOTO
- 903
- 9
- 14