image.html.twig in Image Lazyloader 8
Default theme implementation of an image.
Available variables:
- attributes: HTML attributes for the img tag.
- style_name: (optional) The name of the image style applied.
See also
1 theme call to image.html.twig
- ThemeTest::testThemeLazyloaderImage in tests/
src/ Kernel/ ThemeTest.php - Tests theme_lazyloader_image() and lazyloader's override of theme_image().
File
templates/image.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation of an image.
- *
- * Available variables:
- * - attributes: HTML attributes for the img tag.
- * - style_name: (optional) The name of the image style applied.
- *
- * @see template_preprocess_image()
- *
- * @ingroup themeable
- */
- #}
- {% set classes = [
- theme.settings.image_shape ? theme.settings.image_shape,
- theme.settings.image_responsive ? 'img-responsive',
- ] %}
- <img{{ attributes.addClass(classes) }} />
- {% if old_attributes %}
- <noscript>
- <img{{ old_attributes.addClass(classes) }} />
- </noscript>
- {% endif %}