I'm looking forward to implement taxonomy terms based CSS styling; especially for the body tag which I want to add the current terms.
Here is what I have so far:
function _phptemplate_variables($hook, $vars = array()) {
global $node;
switch ($hook) {
case 'page':
// die ('test');
$vars['body_class'] = '';
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
$vars['body_class'] = 'theme' . arg(2);
}
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
if (is_array($node->taxonomy)) {
foreach ($node->taxonomy as $term) {
$vars['body_class'] .= 'theme'.$term->tid;
}
}
}
if (drupal_is_front_page()) {
$vars['body_class'] .= ' front';
}
break;
}
return $vars;
}
I think the code is OK, but it never get called (see my 'die' function); using simple phptemplate engine and minimal Drupal 6 install.
What obviousness am I missing here?