Main menu

Using Taxonomy Image with Term Queue

Published by shrimphead on Fri, 04/01/2011 - 11:07 in

This code is specific to Drupal 6 and should be placed in the template.php of your theme.

<?php
function hook_preprocess_page(&$vars, $hook) {
 
$vars['term_queue_list'] = hook_term_queue('Name of queue', $taxonomy_list);
}
?>

The above code then calls your specific rendering for each taxonomy element

<?php
function hook_term_queue($queue, $terms) {
  foreach(
$terms as $term) {       
   
// GRAB ASSOCIATED TAXONOMY IMAGE
   
$attributes_sub = array('html' => 'true', 'class' => 'taxonomy-image-term-queue-class',);
   
$image = taxonomy_image_display($term->tid, $attributes_sub, 'image-cache-set');

   
// BUILD OUTPUT HTML LINKS WITH IMAGES
   
$attributes = array('attributes' => array('class' => 'specific-class-here'));
   
$term_list .= l($image, $link, $attributes);
  }
  return
$term_list;
}
?>