diff --git a/templates/_components/picture.twig b/templates/_components/picture.twig index 054df408..7ffb8487 100644 --- a/templates/_components/picture.twig +++ b/templates/_components/picture.twig @@ -11,6 +11,7 @@ @param {string} svgConvertClass @param {string} alt @param {bool} lazy + @param {bool} ratio #} @@ -42,8 +43,9 @@ {# All other image types #} {% set production = craft.app.config.env == 'production' ? true : false %} - {% set lazy = lazy ?? true %} {% set transform = transform ?? [] %} + {% set lazy = lazy ?? true %} + {% set ratio = ratio ?? true %} {% set webp = craft.imager.serverSupportsWebp() and production %} {% set pictureTransform = craft.imager.transformImage( @@ -66,7 +68,14 @@ webp %} - + {% if ratio is defined %} +
+ {% endif %} + + {% if lazy %} {% if webp %} + {% if ratio is defined %} +
+ {% endif %} + {% endif %} {% endif %}