Fix for Code

  1. function dingens_preprocess_page(&$vars) {
  2.   if ($vars['node'] && count($vars['node']->taxonomy)) {
  3.     $term_names = array();
  4.     foreach ($vars['node']->taxonomy as $tid => $term) {
  5.       $term_names[] = strtr($term->name, array(' ' => '-'));
  6.     }
  7.     $vars['body_classes'] .= implode(' ', $term_names);
  8.   }
  9. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.