-1

I have taxonomy images attached to node that I would to make me background image. Previously I used the images uploaded to the node as a background image.

This is the code I used to print out the image:

field_image[LANGUAGE_NONE][0]['uri']); ?>);">

This what I thought it would be but I keep getting errors field_departimage[LANGUAGE_NONE][0]['target_id']['field_image'][LANGUAGE_NONE][0]['uri']); ?>);">

Here's my array. Field_image is the field name attached to the node that links to the taxonomy

array

  • 1
    Please format code as code, and don't use images for text content. Code block is easier to read, easier to copy from, and searchable. – Mołot Aug 27 '15 at 17:09
1

Looks like that field_image is not under target_id try this:

field_departimage[LANGUAGE_NONE][0]['entity']->field_image[LANGUAGE_NONE][0]['uri']); ?>);">

However this not the best way to load field value, you should use field_get_items

  • No didn't work. Just gave me a white screen – drupalnub Aug 27 '15 at 14:37
  • Just updated my answer, term is loaded as an object not array. give it a another try. again you should use field_get_items – sam2de Aug 27 '15 at 14:39
  • It's perfect. Thanks so much. When I have enough points I will vote you up just need one more :) – drupalnub Aug 27 '15 at 14:44
  • you are welcome, you can mark it as an accepted answer. You don't need points to do that. – sam2de Aug 27 '15 at 14:45

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.