You are here

image-formatter-link-to-image-style-formatter.html.twig in Image formatter link to image style 8

Image formatter link to image style theme implementation to display a formatted image field.

Available variables:

  • image: A collection of image data.
  • image_style: An optional image style.
  • url: An URL the image can be linked to.
  • url_rel: An optional URL rel attribute.
  • url_class: An optional URL class attribute.

File

templates/image-formatter-link-to-image-style-formatter.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Image formatter link to image style theme implementation to display a
  5. * formatted image field.
  6. *
  7. * Available variables:
  8. * - image: A collection of image data.
  9. * - image_style: An optional image style.
  10. * - url: An URL the image can be linked to.
  11. * - url_rel: An optional URL rel attribute.
  12. * - url_class: An optional URL class attribute.
  13. *
  14. * @see template_preprocess_image_formatter_link_to_image_style_formatter()
  15. *
  16. * @ingroup themeable
  17. */
  18. #}
  19. <a {% if url_rel %}rel="{{ url_rel }}" {% endif %}{% if url_class %}class="{{ url_class }}" {% endif %}href="{{ url }}">{{ image }}</a>