Categories
Programming

Magento – Inject Body Class via Layout XML

This is an XML piece that has helped me many times. I might wish to style a page or product using a global body level class. In such a case, insert this XML snippet into your desired location.

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