Chris Walton

Magento, add your own body class through XML injection

Adding a custom body class to a Magento page is accomplished pretty easily through XML, now this can be done through your site themes XML files for global changes or within the CMS which would be the easiest way to target a specific CMS, Category or Product page.

Open the page you want to update and add the following code to the Update XML Layout option

<reference name="root">
 <action method="addBodyClass"><classname>my-body-class</classname></action>
</reference> 

And there you go, your page now has thi