Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Changing Body ID dynamically. View modes: 
User avatar
Member
Member
john-squareroot-inc - 9/2/2009 2:58:50 PM
   
Changing Body ID dynamically.
Can I change the body tag's ID property dynamically to make it different for several pages?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 9/4/2009 4:52:57 AM
   
RE:Changing Body ID dynamically.
Hello.

I am not quite sure what ID do you mean. You mean class parameter? If you are using Portal engine, then <solution>/CMSPages/PortalTemplate.aspx is used as master page and you can dynamically change its properties in its code-behind, e.g. in OnPreInit method. E.g. if you want to change class parameter, you can change "this.BodyClass =" parameter. You can change it e.g. on dependance on current node´s alias path using this condition

if (CMS.CMSHelper.CMSContext.CurrentDocument.NodeAlias == "someNodeAlias")
{
this.BodyClass = "something";
}
else
{
this.BodyClass = "somethingElse";
}

If you want to achieve something else, could you please clarify it? Thank you.

Best Regards,
Radek Macalik