Hi,

I am using a custom taxonomy template by using "page-taxonomy.tpl.php". I am able to to print the taxonomy description, however how can I print the taxonomy image associated with the term, therefore the path of the page that would be viewed is: www.example.com/categories/electronics

I would like to use taxonomy image to associate a major image, but not list that image with each node. Therefore, at the top, next to the "term" description I want to output the "term" image. Is this possible? How would this be accomplished in the page-taxonomy.tpl.php file?

Thank you.

Comments

Anonymous’s picture

Status: Active » Closed (fixed)

Found my own solution.. if anyone else is interested.

I used Views 2 to override the taxonomy/term pages. Then created a page-taxonomy.tpl.php file in my themes directory. Then I added the following to display the Taxonomy Term Description, and Taxonomy Term Image:

 if ( arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2)) ) {
  $term = taxonomy_get_term(arg(2));
  $image = taxonomy_image_display($term->tid, NULL, 'Brand_Large');
  // Now the vocabaulary id is available as $term->vid
}
print $image;
print $term->description;
junro’s picture

Hello, I would like Display Image on Term Page: taxonomy/term/%

Where did you find page-taxonomy.tpl.php ?

If I have to create it? What do I have to put in it with the codes above?

Thanks :)

junro’s picture

Status: Closed (fixed) » Active
nancydru’s picture

Status: Active » Fixed

I think there is a simple solution: this can be easily done with Taxonomy List or Taxonomy Context. (You might also look at Taxonomy Menu or Taxonomy Manager.) I am currently working on the 6.x version of TC and think it will do precisely what you want when I am done (right now it is rough, but working well enough to probably do what you need here).

junro’s picture

ok, thanks :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.