image-sizes-formatter.html.twig in Picture 8
Default theme implementation to display a formatted image field.
Available variables:
- image: A collection of image data.
- image_style: An optional image style.
- path: An optional array containing the link 'path' and link 'options'.
- url: An optional URL the image can be linked to.
See also
1 theme call to image-sizes-formatter.html.twig
- ImageSizesFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ ImageSizesFormatter.php - Builds a renderable array for a field value.
File
templates/image-sizes-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.
- * - path: An optional array containing the link 'path' and link 'options'.
- * - url: An optional URL the image can be linked to.
- *
- * @see template_preprocess_image_formatter()
- *
- * @ingroup themeable
- */
- #}
- {% if url %}
- <a href="{{ url }}">
- <picture>
- <!--[if IE 9]><video style="display: none;"><![endif]-->
- {{ source }}
- <!--[if IE 9]></video><![endif]-->
- {{ fallback_image }}
- </picture>
- </a>
- {% else %}
- <picture>
- <!--[if IE 9]><video style="display: none;"><![endif]-->
- {{ source }}
- <!--[if IE 9]></video><![endif]-->
- {{ fallback_image }}
- </picture>
- {% endif %}