Twig image_style_uri

Categories

Component ID

2796995

Component name

Twig image_style_uri

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

86

Component created

Component changed

Component body

This module adds a new twig command
"image_style_url".

It works like the "file_url" command but allows an image style to be chosen.

So for example the following code outputs a url using the "mystyle" image style.
{% set backgroundUrl = image_style_uri(content.field_image.0['#item'].entity.uri.value,'mystyle') %}