image-formatter.html.twig
Default theme implementation to display a formatted image field.
Available variables:
- image: A collection of image data.
- image_style: An optional image style.
- url: An optional URL the image can be linked to.
See also
template_preprocess_image_formatter()
3 theme calls to image-formatter.html.twig
- ImageFormatter::viewElements in core/modules/ image/ src/ Plugin/ Field/ FieldFormatter/ ImageFormatter.php 
- Builds a renderable array for a field value.
- ImageThemeFunctionTest::testImageFormatterTheme in core/modules/ image/ tests/ src/ Kernel/ ImageThemeFunctionTest.php 
- Tests usage of the image field formatters.
- MediaThumbnailFormatter::viewElements in core/modules/ media/ src/ Plugin/ Field/ FieldFormatter/ MediaThumbnailFormatter.php 
- Builds a renderable array for a field value.
File
- 
              core/modules/ image/ templates/ image-formatter.html.twig 
View source
- {#
- /**
-  * @file
-  * Default theme implementation to display a formatted image field.
-  *
-  * Available variables:
-  * - image: A collection of image data.
-  * - image_style: An optional image style.
-  * - url: An optional URL the image can be linked to.
-  *
-  * @see template_preprocess_image_formatter()
-  *
-  * @ingroup themeable
-  */
- #}
- {% if url %}
-   {{ link(image, url) }}
- {% else %}
-   {{ image }}
- {% endif %}
Related topics
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
