Created on 10 January 2025, 3 months ago

I created a new bloc type "hero", and in this block type I have two fields, field_image and field_video, then I created one hero bloc content, and then I placed that in the hero block section (look a bit obisous ;))

But niow I want to do the theming, and I'm using Twig Field Value, I put this code in the block--hero.html.twig:
{{ content.field_image }}
{{ file_url(content.field_image|field_target_entity.uri.value) }}

As a results I have the image :

But I couldn't retrieve the url, do you know what can I do?

and i want to do the same for the video :
{{ content.field_video }}
{{ file_url(content.field_video|field_target_entity.uri.value) }}

But same it's not working

thanks

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇨🇭Switzerland sir_squall

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024