Hi Nancy,
Great module that has solved a number of issues for me.
I have two vocabularies, product category and brand. On the product page I would like to display the brand taxonomy image and not the product taxonomy image.
I'm currently printing the images with print $node->content['taxonomy_image']['#value']; in node.product.tpl.php
In another template I'm using taxonomy_image_display(61, null, null, array('imagecache_preset'=>'square-thumbnails') In this instance I know what the term id is.
I have tried several approaches in the template.
if ($vid==1 ) {
print $node->content['taxonomy_image']['#value'];
} I tried to pull only the term id associated with the brand vocaublary and then print the brand taxonomy image. But I don't seem to be getting the proper term id.
I also tried to find a way to add an id to the individual images so that I could simply hide the product category image.
Comments
Comment #1
apratt commentedIn the hope that if somebody else need to do this they have the tools.
I add this bit of code to the template.php It takes the terms variable apart and reasembles it with spans and divs for theming. I then used display:none to turn on the parts that I needed or didn't need. Ugly but it works.
Comment #2
thepanz commentedMaybe a patch for the node_display module would be nice.
You should check to don't display duplicated ID in the same page, maybe a class="taxonomy-image-tid" can help?
Comment #3
thepanz commentedI've been able to accomplish what you asked:
I can't provide a patch cause a big edit for #413172: Warning on term deletion.
You can try to edit taxonomy_image.module looking for the code (in function taxonomy_image_display() ):
and edit to have that (last line, with CLASS key):
you now will have, for each IMG the class "taxonomy-image-TID" for the representing term.
Comment #4
nancydruWell, duh! Why didn't I think of that a long time ago? Does this work both with and without ImageCache?
Comment #5
thepanz commentedAFAIK it works with both.
Maybe the finest solution is to provide a theme_taxonomy_image_image($image) function...
Comment #6
nancydruFix committed. Thanks, thePanz.
Comment #7
thepanz commentedThank you NancyDru! :)