0

What i want is to have a field called Manufacturer so the user can select the product manufacturer. The way to show the field is an image linking to the Manufacturer page.

example: Product "door handles 0001" has a Manufacturer Audi.

I'm thinking using taxonomy terms with one more field in them (image) but when i import the field just show the name linking to the taxonomy term not the image.

I have see that stackexchange but i can't manage to do it, the patch is a little outdated..

1 Answer 1

1

The easiest answer to your problem might be the taxonomy image module:

"The taxonomy_image module allows site administrators to associate images with taxonomy terms. With the association created, an admin can then make a call to 'taxonomy_image_display()' from their theme or other PHP code to display the appropriate image."

but since you already have a field associated with your taxonomy term, you just want to suppress the output of the tags in your node template and replace it with code that loads the term field and then renders it, ex. roughly:

/* load your term object */
$term= taxonomy_term_load($node->field_tags['und'][0]['tid']);

/* load the entity object (your field names will vary)
$result=field_view_field('taxonomy_term',$term,'field_image','image');

/* display the rendered result, this can be set in manage display for your field to use image styles, etc. */
print render($result);
3
  • is anyway to make the rendered image linking back to the taxonomy term? Commented Nov 16, 2014 at 15:44
  • is any way i can do it? @schnippy Commented Nov 17, 2014 at 9:36
  • Yes - have you tried implementing the above solution? once you have this in your template, you would just wrap your link around the image output.The link itself is just or taxonomy/term/$term->tid or you can pull this from taxonomy_term_uri().
    – schnippy
    Commented Nov 17, 2014 at 23:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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