1

I have an Entity reference field field_video. It's a core Media field with a Reference type of Remote video.

Because I use this field_video in my Hero section I need some additional markup here.

From the admin node/add/page, the editor can insert a Youtube remote video (url).

When I debug the page I see the following variables (see screenshot).

enter image description here

How do I render the media url in node--page.html.twig? Then I am able to build the correct HTML markup and styling around it.

| improve this question | | | | |
0

To get the uri of remote video in node--page.html.twig try with:

node.field_video.entity.field_media_oembed_video.value
| improve this answer | | | | |
  • Thanks that's working. How could I have debugged this? I am using Xdebug and PhpStorm to debug. – meez Jan 20 at 20:34
  • I use drupal.org/project/twig_vardumper module and i dump the entity {{ dump(node.field_video.entity) }} to see the the fields inside the referenced entity – berramou Jan 20 at 21:27

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.