block--system-branding-block.html.twig

Same filename in this branch
  1. 11.x core/profiles/demo_umami/themes/umami/templates/components/branding/block--system-branding-block.html.twig
  2. 11.x core/themes/olivero/templates/block/block--system-branding-block.html.twig
  3. 11.x core/themes/stable9/templates/block/block--system-branding-block.html.twig
  4. 11.x core/themes/claro/templates/classy/block/block--system-branding-block.html.twig
  5. 11.x core/themes/starterkit_theme/templates/block/block--system-branding-block.html.twig
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/templates/components/branding/block--system-branding-block.html.twig
  2. 9 core/themes/olivero/templates/block/block--system-branding-block.html.twig
  3. 9 core/themes/stable9/templates/block/block--system-branding-block.html.twig
  4. 9 core/themes/seven/templates/classy/block/block--system-branding-block.html.twig
  5. 9 core/themes/claro/templates/classy/block/block--system-branding-block.html.twig
  6. 9 core/themes/bartik/templates/block--system-branding-block.html.twig
  7. 9 core/themes/stable/templates/block/block--system-branding-block.html.twig
  8. 9 core/themes/starterkit_theme/templates/block/block--system-branding-block.html.twig
  9. 9 core/themes/classy/templates/block/block--system-branding-block.html.twig
  10. 9 core/modules/system/templates/block--system-branding-block.html.twig
  11. 8.9.x core/profiles/demo_umami/themes/umami/templates/components/branding/block--system-branding-block.html.twig
  12. 8.9.x core/themes/seven/templates/classy/block/block--system-branding-block.html.twig
  13. 8.9.x core/themes/claro/templates/classy/block/block--system-branding-block.html.twig
  14. 8.9.x core/themes/bartik/templates/block--system-branding-block.html.twig
  15. 8.9.x core/themes/stable/templates/block/block--system-branding-block.html.twig
  16. 8.9.x core/themes/classy/templates/block/block--system-branding-block.html.twig
  17. 8.9.x core/modules/system/templates/block--system-branding-block.html.twig
  18. 10 core/profiles/demo_umami/themes/umami/templates/components/branding/block--system-branding-block.html.twig
  19. 10 core/themes/olivero/templates/block/block--system-branding-block.html.twig
  20. 10 core/themes/stable9/templates/block/block--system-branding-block.html.twig
  21. 10 core/themes/claro/templates/classy/block/block--system-branding-block.html.twig
  22. 10 core/themes/starterkit_theme/templates/block/block--system-branding-block.html.twig
  23. 10 core/modules/system/templates/block--system-branding-block.html.twig

Default 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_name: Name for site as defined in Site information settings.
  • site_slogan: Slogan for site as defined in Site information settings.

File

core/modules/system/templates/block--system-branding-block.html.twig

View source
  1. {% extends "block.html.twig" %}
  2. {#
  3. /**
  4. * @file
  5. * Default 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_name: Name for site as defined in Site information settings.
  13. * - site_slogan: Slogan for site as defined in Site information settings.
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. {% block content %}
  19. {% if site_logo %}
  20. <a href="{{ path('<front>') }}" rel="home">
  21. <img src="{{ site_logo }}" alt="{{ 'Home'|t }}" fetchpriority="high" />
  22. </a>
  23. {% endif %}
  24. {% if site_name %}
  25. <a href="{{ path('<front>') }}" rel="home">{{ site_name }}</a>
  26. {% endif %}
  27. {{ site_slogan }}
  28. {% endblock %}

Related topics


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.