I got lost in the tutorial at "Update your theme or other php code to display taxonomy images. To display a taxonomy image from your theme or other php code, add a call to the taxonomy_image_display function. "

Where should i add this call? From what I found, it should be in the template.php file, diurectly below the _phptemplate_variables. This is the result:

function _phptemplate_variables($hook, $vars = array()) {
// Start taxonomy_image display
if ($hook == 'node') {
if (module_exist("taxonomy_image")) {
foreach (taxonomy_node_get_terms($vars['node']->nid) as $term) {
$vars['taxonomy_images'][] = taxonomy_image_display($term->tid, "alt='$term->name'");
}
}
}
return $vars;
}
// End taxonomy_image display

// Get the currently logged in user
global $user;
// Rest of the phptemplate variables function
...

Is that correct? Thanks!

Comments

ThePickwickProject’s picture

I guess as an alternative, i could use http://drupal.org/node/197369

nancydru’s picture

I think that looks reasonable, but does not actually get the images on the display - that will take companion code in node.tpl.php.

nancydru’s picture

Title: Invoke the taxonomy image: where? » Improve documentation.
Assigned: Unassigned » nancydru
Category: support » task

Changing title and category.

The documentation needs to be updated with recent changes, plus more detailed information on theme usage.

See also: http://drupal.org/node/183623
See also: http://drupal.org/node/152081 (lots of good example)
See also: http://drupal.org/node/115277

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

Does anyone want to pitch in on the theming part?

nancydru’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

I guess not