Automatic Iteration?

krisvannest - February 18, 2007 - 21:47
Project:Taxonomy image
Version:4.7.x-1.x-dev
Component:Code
Category:feature request
Priority:minor
Assigned:Unassigned
Status:won't fix
Description

1st, thanks a ton for this mod; having it working and does exactly what I need.

However, I was a bit confused at 1st because I thought it would work like the following:

  1. Setup as described in readme, except that...
  2. ...the only code needed for us to add in node.tpl.php would be:
    print taxonomy_image_display($terms);

See, I thought that by calling just this single line in #2 above (or something similar as I'm not all that PHP savvy), the module would automatically iterate through all the $terms of the current node. 'course in actuality, I had to use the following which seems to work well:

foreach (taxonomy_node_get_terms($node->nid) as $term) {
echo "<a href=\"".base_path()."taxonomy/term/".$term->tid."\">".taxonomy_image_display($term->tid, " alt='$term->name'")."</a>";
}

Not a big problem because I found that code through another new user's post/question... I think either http://drupal.org/node/113690 or http://drupal.org/node/71704... but I guess I'm just wondering if the module could be setup to actually do what I expected at 1st, basically iterate through all the current node's terms by itself w/out us having to add the additional foreach loop.

Like I said, not a big deal, and have no idea if that would be doable or lessen flexibility, but just proposing it in case it would help get other new users up to speed faster and possibly reduce support queries.

And thanx again; super module.

-KV

#1

NancyDru - February 6, 2008 - 01:07
Status:active» won't fix

I don't see this as very do-able, except maybe as a new function that would do what you're doing.

 
 

Drupal is a registered trademark of Dries Buytaert.