function _phptemplate_variables($hook, $vars = array()) { switch ($hook) { // Send a new variable, $has_terms, to see wether the current node has any terms case 'node': if(count(taxonomy_node_get_terms($vars['node']->nid))) { $vars['has_terms'] = TRUE; } else { $vars['has_terms'] = FALSE; } if ($vars['teaser']) { $vars['template_files'][] = 'node-teaser'; $vars['template_files'][] = 'node-teaser-'. $vars['node']->type; } } return $vars; }