0

Hi Im using taxonomies for categorize my products with drupal commerce, Im using "Brand" vocabulary for the products I want to display a thumbnail of the brand instead of the name of the brand in text, for use in views when showing the products in a catalog, or in the main page of the product display when editing the display of the product display...

Any idea. Thanks

1

You can use the Entity Module which will allow you to add an image field to the taxonomy.

Then instead of displaying the term->name you'll be able to display your image.

You can create a field image field_brand_logo and get it this way :

$term = taxonomy_term_load($tid);
$brand_logo = field_get_items('taxonomy_term', $term, 'field_brand_logo');
if (!empty($brand_logo)) {
   $brand_logo_img = field_view_value('taxonomy_term', $term, 'field_brand_logo', $brand_logo[0], array('type' => 'image'));
}

print render($brand_logo_img);
  • Hope it will fit your needs ;-) – pbonnefoi Jul 1 '14 at 16:22
0

This is probably what you're looking for: https://www.drupal.org/node/1224916

  • that module is deprecated for drupal 7, could you tell me the steps? – SsouLlesS Jul 1 '14 at 15:50
  • Sorry, revised answer, looks like 'imagefield' does the same thing in 7... – iain maitland Jul 1 '14 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.