Need way to add custom class names to body tag.
Customizing via CMSContext.CurrentBodyClass isn't sufficient -- it's clumsy and subject to deprecation.
Hello and thanks for the suggestion.
As the Portal engine is no longer our primary development model, we have no plan to extend this functionality.
Please consider the MVC development model instead.
Mark Handy commented
I needed a custom class so i could identify the page. I put this together. I'm running an ASPX/Portal build.
// we grab the alias path from Kentico, and trim the leading forward slash
string aliasPath = CMS.DocumentEngine.DocumentContext.OriginalAliasPath.ToLower().TrimStart('/');
if (aliasPath == "")
this.BodyClass += " homePage";
this.BodyClass += " " + aliasPath.Replace("/", "--");
our support made a custom web part named "Add Body Class". Very widely used indeed
Charles Hunter commented