Print field content as div attribute in views template Using Drupal 8

I have a view:


Unformatted List
Two fields, Title and an Image with Image URL formatter via the module Image Url Formatter


I need to print out that URL such that:



The problem lies in the fact that I have TWIG DEBUGGING enabled , so the output of the field also includes all the debug mumbo-jumbo that I don't need. I don't want to have to be turning on/off debugging to make sure this works, I want a way to print the content without that mumbo jumbo. 

I thought this post would help. It explains that field.content contains the rendered field, and what I am looking for is the field data from the database. 

When trying this out with views-view-fields.html.twig , the code row._entity.field_art_image.value works great but it returns the information about the image itself (alt, title, width, height..) but not its URL. 

Is there a way for me to access either the image url that points to the Image Style applied to the filed? (For example /sites/default/files/styles/large/public/2016-11/feature-javelin-throw.jpg?itok=UJugCoqn . 

Trying file_url(row._entity.field_art_image.entity.uri.value) works, but it returns the URL to the uploaded image, not the one that results from the Image Style applied.
The code you linked is for normal data fields like text or number.

{{ row._entity.field_field_text.value }}


An image is a reference field, which has no value property, but a target entity. This has it's own set of fields. In case of an image the target is a file entity with the field uri, from which you can get the url with file_url().

{{ file_url(row._entity.field_image.entity.uri.value) }}


Or use Twig Tweak to generate an image style url:

{{ row._entity.field_image.entity.uri.value | image_style('thumbnail') }}