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
Comment #1
ThePickwickProject commentedI guess as an alternative, i could use http://drupal.org/node/197369
Comment #2
nancydruI think that looks reasonable, but does not actually get the images on the display - that will take companion code in node.tpl.php.
Comment #3
nancydruChanging 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
Comment #4
nancydruDoes anyone want to pitch in on the theming part?
Comment #5
nancydruI guess not