You are here

formatter-suite-general-image-formatter.html.twig in Formatter Suite 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.
  • attributes: Optional attributes for the image link, if any.

File

templates/formatter-suite-general-image-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. * - url: An optional URL the image can be linked to.
  10. * - attributes: Optional attributes for the image link, if any.
  11. *
  12. * @see template_preprocess_image_formatter()
  13. *
  14. * @ingroup themeable
  15. */
  16. #}
  17. {% if url %}
  18. <a href="{{ url }}" {{ attributes }}>{{ image }}</a>
  19. {% else %}
  20. {{ image }}
  21. {% endif %}