image-style.html.twig
Same filename in this branch
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()
4 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.
- ImageWidget::process in core/
modules/ image/ src/ Plugin/ Field/ FieldWidget/ ImageWidget.php - Form API callback: Processes an image_image field element.
- MediaListBuilder::buildRow in core/
modules/ media/ src/ MediaListBuilder.php - Builds a row for an entity in the entity listing.
- template_preprocess_image_formatter in core/
modules/ image/ image.field.inc - Prepares variables for image formatter templates.
File
-
core/
themes/ stable9/ 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 }}