image-url-formatter.html.twig in Image URL Formatter 8
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
1 theme call to image-url-formatter.html.twig
- ImageUrlFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ ImageUrlFormatter.php - Builds a renderable array for a field value.
File
templates/image-url-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
- */
- #}
- {% spaceless %}
- {% if url %}
- {{ url }}
- {% else %}
- {{ image }}
- {% endif %}
- {% endspaceless %}