You are here

image-jssor-formatter.html.twig in Jssor Slider 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.
  • caption: Weither or not to display a caption.
  • caption_text: Caption text.

File

templates/image-jssor-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. * - caption: Weither or not to display a caption.
  11. * - caption_text: Caption text.
  12. *
  13. * @see template_preprocess_image_jssor_formatter()
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. <div>
  19. {% if url %}
  20. <a href="{{ url }}">{{ image }}</a>
  21. {% else %}
  22. {{ image }}
  23. {% endif %}
  24. {% if caption %}
  25. <div u="caption" t='{{ play_in_transition }}' t2='{{ play_out_transition }}' class="slider__caption">
  26. <div class="slider__caption--background">
  27. </div>
  28. <div class="slider__caption--title">
  29. {{ caption_text }}
  30. </div>
  31. </div>
  32. {% endif %}
  33. </div>