Same filename in this branch
  1. 10 core/modules/image/templates/image-style.html.twig
  2. 10 core/themes/stable9/templates/field/image-style.html.twig
  3. 10 core/themes/starterkit_theme/templates/field/image-style.html.twig
Same filename and directory in other branches
  1. 8.9.x core/modules/image/templates/image-style.html.twig
  2. 9 core/modules/image/templates/image-style.html.twig

Default theme implementation 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()

7 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.

... See full list

File

core/modules/image/templates/image-style.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for an image using a specific image style.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the image, including the following:
  8. * - src: Full URL or relative path to the image file.
  9. * - class: One or more classes to be applied to the image.
  10. * - width: The width of the image (if known).
  11. * - height: The height of the image (if known).
  12. * - title: The title of the image.
  13. * - alt: The alternative text for the image.
  14. *
  15. * @see template_preprocess_image_style()
  16. *
  17. * @ingroup themeable
  18. */
  19. #}
  20. {{ image }}

Related topics