You are here

image.html.twig in Open Social 8.5

Default theme implementation of an image.

Available variables:

  • attributes: HTML attributes for the img tag.
  • style_name: (optional) The name of the image style applied.

File

themes/socialbase/templates/system/image.html.twig
View source
  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 == 'social_large' %}
  16. {% set classes = [
  17. 'hero-avatar'
  18. ] %}
  19. {% else %}
  20. {% set classes = [
  21. theme.settings.image_shape ? theme.settings.image_shape,
  22. theme.settings.image_responsive ? 'img-responsive',
  23. ] %}
  24. {% endif %}
  25. <img{{ attributes.addClass(classes) }} />