You are here

block--amp-system-branding-block.html.twig in Accelerated Mobile Pages (AMP) 8.3

Theme override 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_name: Name for site as defined in Site information settings.
  • site_slogan: Slogan for site as defined in Site information settings.
  • logo_width: Width of the logo.
  • logo_height: Height of the logo.

File

templates/block--amp-system-branding-block.html.twig
View source
  1. {% extends "block.html.twig" %}
  2. {#
  3. /**
  4. * @file
  5. * Theme override 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_name: Name for site as defined in Site information settings.
  13. * - site_slogan: Slogan for site as defined in Site information settings.
  14. * - logo_width: Width of the logo.
  15. * - logo_height: Height of the logo.
  16. */
  17. #}
  18. {% block content %}
  19. <div class="amp-system-branding-block">
  20. {% if site_logo %}
  21. <a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home" class="site-logo">
  22. <amp-img src="{{ site_logo }}" alt="{{ 'Home'|t }}" width="{{ logo_width }}" height="{{ logo_height }}"> </amp-image>
  23. </a>
  24. {% endif %}
  25. {% if site_name %}
  26. <div class="site-name">
  27. <a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
  28. </div>
  29. {% endif %}
  30. {% if site_slogan %}
  31. <div class="site-slogan">{{ site_slogan }}</div>
  32. {% endif %}
  33. </div>
  34. {% endblock %}