You are here

textimage-formatter.html.twig in Textimage 8.3

Same filename and directory in other branches
  1. 8.4 templates/textimage-formatter.html.twig

Default theme implementation to display a Textimage formatter theme.

Available variables:

  • image: A collection of image data.
  • anchor_url: (Optional) if specified, the entire output will be wrapped in a <a> anchor.
  • anchor_attributes: (Optional) the 'href' attributes of the anchor.
  • image_container_attributes : (Optional) if specified, the <img> tag will be wrapped in a <div> container, whose attributes will be set to the array passed here.

File

templates/textimage-formatter.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a Textimage formatter theme.
  5. *
  6. * Available variables:
  7. * - image: A collection of image data.
  8. * - anchor_url: (Optional) if specified, the entire output will be wrapped
  9. * in a <a> anchor.
  10. * - anchor_attributes: (Optional) the 'href' attributes of the anchor.
  11. * - image_container_attributes : (Optional) if specified, the <img> tag will
  12. * be wrapped in a <div> container, whose attributes will be set to the
  13. * array passed here.
  14. *
  15. * @see template_preprocess_textimage_formatter()
  16. *
  17. * @ingroup themeable
  18. */
  19. #}
  20. {% spaceless %}
  21. {% if image %}
  22. {% if anchor_url %}
  23. <a {{ anchor_attributes }}>
  24. {% endif %}
  25. {% if image_container_attributes %}
  26. <div {{ image_container_attributes }}>
  27. {% endif %}
  28. {{ image }}
  29. {% if image_container_attributes %}
  30. </div>
  31. {% endif %}
  32. {% if anchor_url %}
  33. </a>
  34. {% endif %}
  35. {% else %}
  36. {{ 'Image not available.'|t }}
  37. {% endif %}
  38. {% endspaceless %}