You are here

block--system-branding-block.html.twig in Thunder 8.2

Theme implementation for a branding block.

Each branding element variable (logo, name, slogan) is only available if enabled in the block configuration.

Available variables:

  • site_logo: Logo for site as defined in Appearance or theme settings.
  • site_logo_height: Height of the logo, if available.
  • site_logo_width: Width of the logo, if available.
  • site_name: Name for site as defined in Site information settings.
  • site_slogan: Slogan for site as defined in Site information settings.

File

themes/thunder_amp/templates/block/block--system-branding-block.html.twig
View source
  1. {% extends "block.html.twig" %}
  2. {#
  3. /**
  4. * @file
  5. * Theme implementation for a branding block.
  6. *
  7. * Each branding element variable (logo, name, slogan) is only available if
  8. * enabled in the block configuration.
  9. *
  10. * Available variables:
  11. * - site_logo: Logo for site as defined in Appearance or theme settings.
  12. * - site_logo_height: Height of the logo, if available.
  13. * - site_logo_width: Width of the logo, if available.
  14. * - site_name: Name for site as defined in Site information settings.
  15. * - site_slogan: Slogan for site as defined in Site information settings.
  16. */
  17. #}
  18. {% set attributes = attributes.addClass('site-branding', 'clearfix') %}
  19. {% block content %}
  20. {% if site_logo and site_logo_height and site_logo_width %}
  21. <a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home" class="site-branding__logo">
  22. <amp-img src="{{ site_logo }}" alt="{{ 'Home'|t }}"
  23. height="{{ site_logo_height }}" width="{{ site_logo_width }}"
  24. layout="responsive"
  25. ></amp-img>
  26. </a>
  27. {% endif %}
  28. {% if site_name or site_slogan %}
  29. <div class="site-branding__text">
  30. {% if site_name %}
  31. <div class="site-branding__name">
  32. <a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
  33. </div>
  34. {% endif %}
  35. {% if site_slogan %}
  36. <div class="site-branding__slogan">{{ site_slogan }}</div>
  37. {% endif %}
  38. </div>
  39. {% endif %}
  40. {% endblock %}