I have a taxonomy term with the name 'Colors' and it has 1 image field called field_color_image. In my project I have a node type with a field type of Taxonomy term that refer to Colors. My aim is that I want to show the image in the Colors taxonomy to a node. I already used kint and it didn't really help. How do I achieve this? Thank you beforehand.
1 Answer
To get the url of your term reference image inside the node twig try:
node.field_color_term.0.entity.field_color_image.entity.uri.0.value
Change field_color_term
by your field name.
There is another way by configuring the display of your content type and your term like the following:
After this configuration you can render your field type of Taxonomy term, it will show the image:
{{ content.field_YOURFIELDNAME }}
-
node.field_color_term.0.entity.field_color_image.entity.uri.0.value really saved the day! Thank you! Commented Apr 27, 2020 at 1:50
-