Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > current document name to body class View modes: 
User avatar
Member
Member
jao - 3/11/2010 8:54:07 AM
   
current document name to body class
How do I add the current document name to the body CSS class property?

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 3/22/2010 2:17:19 PM
   
RE:current document name to body class
Hello,

You can achieve this by adding following expression to ~\CMSPages\PortalTemplate.aspx.cs page to OnPreRender method:

string docName = CMS.CMSHelper.CMSContext.CurrentDocument.DocumentName.ToString().ToLower();
this.DocumentBase.BodyClass = this.DocumentBase.BodyClass + " " + docName;


Best regards
Ondrej Vasil