I’m trying to customize a content display via Twig, overriding its template. I have a field which references a content type named Post, and inside the content Type post, I have a field which references an Image from the Media module (the new one). As everyone knows, inside the Image media type there’s the image field which is the image itself.
Currently, we can get the data from the content type named Post, but we can’t find a way to render the Image which is inside Post. We tried to debug with Twig debug, but can’t find the correct way to display it.
Just to be clear, this is how the relationship looks like:
- the content I'm overriding the template -- field_lista_de_posts (inside this content, which is a reference to Post [max of 3 Posts I can reference]) --- the Post content type ---- field_imagem_de_destaque (inside Post, which is a reference to Image from Media module) ----- the Image media type ------ field_media_image (inside Image media type, which is a Image field)
The closest we could get is with this line of code:
But it barely returns a ‘/’.