I'm working with Drupal 8 and twig
I created a Drupal content type called hero. It contains a title, body copy and an image. I'm overwriting node.html.twig for this content type but am having trouble accessing the image source to generate html I need to.
<div {{ attributes.addClass(classes) }} style="background-image: url(/img/site/about/about_hero_banner.jpg);"> <div class="row"> <div class="col-sm-7"> <div class="copy"> <h1> Headline </h1> <p> Subhead Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex, sed voluptatum fugit ipsa animi quos nobis? </p> </div> </div> </div> </div> I can access the Headline and title with the code below but I don't want to load the image file I want only want the image path (source).
{{ content.body }} {{ content.field_headline }} {{ content.field_hero_image }} How do I get the image file path from in my node template from {{ content.field_hero_image }}? How do I access the attributes of content.field_hero_image?
I've looked at image.html.twig and see
<img{{ attributes }} /> So I know it's in the attributes, but don't know how to access the attributes from the node template.