You are here

responsive-image-formatter.html.twig in Drupal 10

Theme override to display a formatted responsive image field.

Available variables:

  • responsive_image: A collection of responsive image data.
  • url: An optional URL the image can be linked to.

File

core/themes/stable/templates/field/responsive-image-formatter.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override to display a formatted responsive image field.
  5. *
  6. * Available variables:
  7. * - responsive_image: A collection of responsive image data.
  8. * - url: An optional URL the image can be linked to.
  9. *
  10. * @see template_preprocess_responsive_image_formatter()
  11. */
  12. #}
  13. {% if url %}
  14. <a href="{{ url }}">{{ responsive_image }}</a>
  15. {% else %}
  16. {{ responsive_image }}
  17. {% endif %}