Reputation: 181
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?
Upvotes: 3
Views: 1511
Reputation: 1442
<body class="{% CurrentDocument.NodeClass.ClassName.ToString() #%}">
Upvotes: 5
Reputation: 911
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!
Upvotes: 2
Reputation: 1549
Following is a macro, that gives you page type info object:
{% DocumentContext.CurrentDocument.NodeClass #%}
Go to System -> Macros -> Console to see/try available macros.
Upvotes: 7