image.html.twig 704 B

12345678910111213141516171819202122232425262728293031
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of an image.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the img tag.
  8. * - style_name: (optional) The name of the image style applied.
  9. *
  10. * @see template_preprocess_image()
  11. *
  12. * @ingroup themeable
  13. */
  14. #}
  15. {% if style_name == "lightbox" %}
  16. {#
  17. <img{{ attributes }} />
  18. #}
  19. {# <pre>
  20. {{ dump(attributes) }}
  21. </pre> #}
  22. <a href="{{attributes.src}}" data-lightbox="lightbox" data-title="{{attributes.title}}">
  23. <img src="{{attributes.src}}" alt="">
  24. </a>
  25. {# <a href="{{attributes.src}}" data-lightbox="lightbox">image</a> #}
  26. {% else %}
  27. <img{{ attributes }} />
  28. {% endif %}