Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello.
I'm trying to build an override twig for a field collection in D8. My field collection has Text and Image Fields. I'm not able to print out the image through.
Is there any way to get the path of an image that is set in an image field of a field collection?
Either in the image field array or somewhere else?
Specifically here's my current twig statement:
To get the field_product_image:
{{ item.content['#field_collection_item'].field_product_image.getValue()[0] }}
Attached is my kint output for the field collection
Thanks.
Paul L.
Comment | File | Size | Author |
---|---|---|---|
Screen Shot 2016-01-13 at 1.36.36 PM.png | 192.22 KB | paul.lefebvre07 |
Comments
Comment #2
paul.lefebvre07 CreditAttribution: paul.lefebvre07 commentedComment #3
paul.lefebvre07 CreditAttribution: paul.lefebvre07 commentedComment #4
dramblys CreditAttribution: dramblys commentedPlease review https://www.drupal.org/node/2649056#comment-10845984
Comment #5
jmuzz CreditAttribution: jmuzz commented