You are here

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.

File

templates/image-sizes-formatter.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a formatted image field.
  5. *
  6. * Available variables:
  7. * - image: A collection of image data.
  8. * - image_style: An optional image style.
  9. * - path: An optional array containing the link 'path' and link 'options'.
  10. * - url: An optional URL the image can be linked to.
  11. *
  12. * @see template_preprocess_image_formatter()
  13. *
  14. * @ingroup themeable
  15. */
  16. #}
  17. {% if url %}
  18. <a href="{{ url }}">
  19. <picture>
  20. <!--[if IE 9]><video style="display: none;"><![endif]-->
  21. {{ source }}
  22. <!--[if IE 9]></video><![endif]-->
  23. {{ fallback_image }}
  24. </picture>
  25. </a>
  26. {% else %}
  27. <picture>
  28. <!--[if IE 9]><video style="display: none;"><![endif]-->
  29. {{ source }}
  30. <!--[if IE 9]></video><![endif]-->
  31. {{ fallback_image }}
  32. </picture>
  33. {% endif %}