image.html.twig
Same filename in this branch
Theme override of an image.
Available variables:
- attributes: HTML attributes for the img tag.
- style_name: (optional) The name of the image style applied.
See also
12 theme calls to image.html.twig
- ContextualHooks::help in core/
modules/ contextual/ src/ Hook/ ContextualHooks.php - Implements hook_help().
- FilemimeFormatter::viewValue in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FilemimeFormatter.php - Generate the output appropriate for one field item.
- LayoutDefinition::getIcon in core/
lib/ Drupal/ Core/ Layout/ LayoutDefinition.php - Builds a render array for an icon representing the layout.
- OEmbedFormatter::viewElements in core/
modules/ media/ src/ Plugin/ Field/ FieldFormatter/ OEmbedFormatter.php - Builds a renderable array for a field value.
- SystemBrandingBlock::build in core/
modules/ system/ src/ Plugin/ Block/ SystemBrandingBlock.php - Builds and returns the renderable array for this block plugin.
File
-
core/
profiles/ demo_umami/ themes/ umami/ templates/ classy/ field/ image.html.twig
View source
- {#
- /**
- * @file
- * Theme override 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()
- */
- #}
- {%
- set classes = [
- style_name ? 'image-style-' ~ style_name|clean_class,
- ]
- %}
- <img{{ attributes.addClass(classes) }} />