You are here

instagram-block-image.html.twig in Instagram Block 8.3

Default theme implementation of an Instagram image link.

Available variables:

  • data: The entire data array returned from the Instagram API request.
  • href: The url to the Instagram post page.
  • src: The source url to the instagram image.
  • width: The display width of the image.
  • height: The display height of the image.

File

templates/instagram-block-image.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of an Instagram image link.
  5. *
  6. * Available variables:
  7. * - data: The entire data array returned from the Instagram API request.
  8. * - href: The url to the Instagram post page.
  9. * - src: The source url to the instagram image.
  10. * - width: The display width of the image.
  11. * - height: The display height of the image.
  12. *
  13. * @ingroup themeable
  14. */
  15. #}
  16. {% if height is empty %}
  17. {% set width_and_height = '' %}
  18. {% else %}
  19. {% set width_and_height = 'height="' ~ height ~ 'px"' %}
  20. {% endif %}
  21. {% if width is not empty %}
  22. {% set width_and_height = width_and_height ~ ' width="' ~ width ~ 'px"' %}
  23. {% endif %}
  24. {% spaceless %}
  25. <a class="group" target="_blank" data-instagram-rel="1" href="{{ href }}">
  26. <img alt="{{ data.caption.text }}" {{ width_and_height }} src="{{ src }}">
  27. </a>
  28. {% endspaceless %}