phptemplate_body_class

Versions
5
phptemplate_body_class($sidebar_left, $sidebar_right)
6
phptemplate_body_class($left, $right)

Sets the body-tag class attribute.

Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.

Code

themes/garland/template.php, line 8

<?php
function phptemplate_body_class($left, $right) {
  if ($left != '' && $right != '') {
    $class = 'sidebars';
  }
  else {
    if ($left != '') {
      $class = 'sidebar-left';
    }
    if ($right != '') {
      $class = 'sidebar-right';
    }
  }

  if (isset($class)) {
    print ' class="'. $class .'"';
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.