All pastes #764713 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-11-07 14:32 UTC
rendered paste body
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;
}