Print Taxonomy Term in block.tpl.php I am using a specific content type as blocks (via Nodeblock Module). The nodes have certain taxonomy terms referenced via a term reference field, which I would like to print out in the corresponding block.tpl.php to use them as block classes. Same procedure as one would print terms as body classes, but only in block classes array. I find solutions for printing the term field in node.tpl and page.tpl but not in block.tpl.php
Glad for any help on this
thanks
Matthias
Here is code tested to work on a minimal install with nodeblock. It's well commented but to recap: get the node displayed in the block, get the term, use one the term's field as css class.

// change mytheme to your theme's name
function mytheme_preprocess_block(&amp;$vars) {
  // don't do anything if it's not a nodeblock block
  if (empty($vars["elements"]["#node"]) || !is_object($vars["elements"]["#node"])) {
    return;
  }

  // get the node object, already loaded
  $node = $vars["elements"]["#node"];

  // get the linked term's id (change field_term to yours)
  $tid = $node-&gt;field_term[LANGUAGE_NONE][0]['tid'];

  // load the term fully to get access to its fields
  $term = taxonomy_term_load($tid);

  // turn one of the term's field into a css class (change name to any field)
  $css_class = drupal_clean_css_identifier($term-&gt;name);

  // add the css class to the list of classes for this block
  $vars["classes_array"][] = $css_class;
}