Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

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

Same filename in this branch
  1. 11.1.x core/profiles/demo_umami/themes/umami/templates/components/branding/block--system-branding-block.html.twig
  2. 11.1.x core/themes/stable9/templates/block/block--system-branding-block.html.twig
  3. 11.1.x core/themes/starterkit_theme/templates/block/block--system-branding-block.html.twig
  4. 11.1.x core/themes/claro/templates/classy/block/block--system-branding-block.html.twig
  5. 11.1.x core/modules/system/templates/block--system-branding-block.html.twig

Olivero's 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/themes/olivero/templates/block/block--system-branding-block.html.twig

View source
  1. {% extends "block.html.twig" %}
  2. {#
  3. /**
  4. * @file
  5. * Olivero's 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. #}
  16. {% set attributes = attributes.addClass('site-branding') %}
  17. {% block content %}
  18. <div class="site-branding__inner">
  19. {% if site_logo %}
  20. <a href="{{ path('<front>') }}" rel="home" class="site-branding__logo">
  21. <img src="{{ site_logo }}" alt="{{ 'Home'|t }}" fetchpriority="high" />
  22. </a>
  23. {% endif %}
  24. {% if site_name %}
  25. <div class="site-branding__text">
  26. <div class="site-branding__name">
  27. <a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
  28. </div>
  29. </div>
  30. {% endif %}
  31. </div>
  32. {% endblock %}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal