Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The Zen theme allows designers to adapt their layout based on the classes that are applied to the body. You can add this level of customization to your theme as well. To add classes to your page, you will need to alter the contents of the page variable $body_classes. This variable contains a list of classes all separated by a space. To add new classes to this variable, you can use the same function that was described previously in this chapter. In the code outlined in the section “New Templates from Aliased URLs,” replace step 8 with the following lines (the first line is a comment, not part of the functioning code):
// Step 8:
$classes = implode(' page-', $templates);
$variables['body_classes'] = $variables['body_classes'] . ' $classes';This will add your new body classes to the end of the list of default classes.
Additional body classes are available
|
| If you want to have even more classes available for theming, you may find the Themer module useful. This tiny module creates a suite of CSS classes that can be applied throughout your theme. Additional information is available on the project page at http://drupal.org/project/themer. |