image-style.html.twig
Same filename in this branch
Same filename in other branches
- 9 core/themes/stable9/templates/field/image-style.html.twig
- 9 core/themes/stable/templates/field/image-style.html.twig
- 9 core/themes/starterkit_theme/templates/field/image-style.html.twig
- 9 core/themes/classy/templates/field/image-style.html.twig
- 9 core/modules/image/templates/image-style.html.twig
- 8.9.x core/themes/stable/templates/field/image-style.html.twig
- 8.9.x core/themes/classy/templates/field/image-style.html.twig
- 8.9.x core/modules/image/templates/image-style.html.twig
- 11.x core/themes/stable9/templates/field/image-style.html.twig
- 11.x core/themes/starterkit_theme/templates/field/image-style.html.twig
- 11.x core/modules/image/templates/image-style.html.twig
Theme override for an image using a specific image style.
Available variables:
- attributes: HTML attributes for the image, including the following:
- src: Full URL or relative path to the image file.
- class: One or more classes to be applied to the image.
- width: The width of the image (if known).
- height: The height of the image (if known).
- title: The title of the image.
- alt: The alternative text for the image.
See also
template_preprocess_image_style()
8 theme calls to image-style.html.twig
- AddFormBase::buildEntityFormElement in core/
modules/ media_library/ src/ Form/ AddFormBase.php - Builds the sub-form for setting required fields on a new media item.
- ImageDimensionsTest::testImageDimensions in core/
modules/ image/ tests/ src/ Functional/ ImageDimensionsTest.php - Tests styled image dimensions cumulatively.
- ImageFieldDisplayTest::testImageLoadingAttribute in core/
modules/ image/ tests/ src/ Functional/ ImageFieldDisplayTest.php - Tests for image loading attribute settings.
- ImageFieldDisplayTest::_testImageFieldFormatters in core/
modules/ image/ tests/ src/ Functional/ ImageFieldDisplayTest.php - Tests image formatters on node display.
- ImageThemeFunctionTest::testImageStyleTheme in core/
modules/ image/ tests/ src/ Kernel/ ImageThemeFunctionTest.php - Tests usage of the image style theme function.
File
-
core/
themes/ starterkit_theme/ templates/ field/ image-style.html.twig
View source
- {#
- /**
- * @file
- * Theme override for an image using a specific image style.
- *
- * Available variables:
- * - attributes: HTML attributes for the image, including the following:
- * - src: Full URL or relative path to the image file.
- * - class: One or more classes to be applied to the image.
- * - width: The width of the image (if known).
- * - height: The height of the image (if known).
- * - title: The title of the image.
- * - alt: The alternative text for the image.
- *
- * @see template_preprocess_image_style()
- */
- #}
- {{ image }}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.