I need to display two versions of the image on my Drupal 8 website - one for "wide" viewport, another for "narow".
I can do it by CSS classes and media queries, but the user will have to load both versions of the image. I would like to avoid it.
I have decided to exploit <picture>
tag. I see two possible options, but none worked for me:
1) I have tried to define type of content (banner) which contains two image fields (my 2 versions of the image). Then in the appropriate View I rewrote some field to "manually" insert <picture>
tag. Unfortunatelly, it seems Views in Drupal strip this tag.
2) There is "Responsive Image" module, but it deals with the same source image served in different sizes. It is not my problem: I need two different images.
So, I need some advice how either prevent stripping of <picture>
tag in Views or how to add some kind of Picture field to field types.