Recipe 82: Body classes
"Body classes" might sound, at first, like a great way to lose weight and get strong, but in the context of a Drupal web site they are simply a set of CSS classes on the opening body tag. Examples might include:
<body class="sidebars"> <body class="sidebar-left"> <body class="front logged-in one-sidebar sidebar-left">
This may not look that exciting, but body classes actually yield a lot of power to Drupal themers.
For our example, let's consider a site set up by the designer to include a background image on two sidebar columns. The layout works for most of the content on the site. But we need to provide more space for selected wide pages. It's easy to configure blocks to show on every page except on the wide-stance
view, for instance. That provides the physical room for the view. But what of the sidebar columns, which have a repeat-y image on the background property? Will the graphic still extend from top-to-bottom even if the sidebars are gone...