image-formatter.html.twig in Zircon Profile 8
Same filename in this branch
Same filename and directory in other branches
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
2 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/ src/ Tests/ ImageThemeFunctionTest.php - Tests usage of the image field formatters.
File
core/modules/image/templates/image-formatter.html.twigView 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 %}
- <a href="{{ url }}">{{ image }}</a>
- {% else %}
- {{ image }}
- {% endif %}