You are here

image-formatter.html.twig in Zircon Profile 8.0

Theme override 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

core/themes/classy/templates/field/image-formatter.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override 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. #}
  15. {% if url %}
  16. <a href="{{ url }}">{{ image }}</a>
  17. {% else %}
  18. {{ image }}
  19. {% endif %}