admin-block.html.twig

Same filename in this branch
  1. 10 core/modules/system/templates/admin-block.html.twig
Same filename in other branches
  1. 9 core/themes/stable9/templates/admin/admin-block.html.twig
  2. 9 core/themes/stable/templates/admin/admin-block.html.twig
  3. 9 core/modules/system/templates/admin-block.html.twig
  4. 8.9.x core/themes/stable/templates/admin/admin-block.html.twig
  5. 8.9.x core/modules/system/templates/admin-block.html.twig
  6. 11.x core/themes/stable9/templates/admin/admin-block.html.twig
  7. 11.x core/modules/system/templates/admin-block.html.twig

Theme override for an administrative block.

Available variables:

  • block: An array of information about the block, including:

    • show: A flag indicating if the block should be displayed.
    • title: The block title.
    • content: (optional) The content of the block.
    • description: (optional) A description of the block. (Description should only be output if content is not available).
  • attributes: HTML attributes for the containing div element.
2 theme calls to admin-block.html.twig
template_preprocess_admin_page in core/modules/system/system.admin.inc
Prepares variables for administrative index page templates.
template_preprocess_system_admin_index in core/modules/system/system.admin.inc
Prepares variables for admin index templates.

File

core/themes/stable9/templates/admin/admin-block.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for an administrative block.
  5. *
  6. * Available variables:
  7. * - block: An array of information about the block, including:
  8. * - show: A flag indicating if the block should be displayed.
  9. * - title: The block title.
  10. * - content: (optional) The content of the block.
  11. * - description: (optional) A description of the block.
  12. * (Description should only be output if content is not available).
  13. * - attributes: HTML attributes for the containing div element.
  14. */
  15. #}
  16. {%
  17. set classes = [
  18. 'panel',
  19. ]
  20. %}
  21. <div{{ attributes.addClass(classes) }}>
  22. {% if block.title %}
  23. <h3 class="panel__title">{{ block.title }}</h3>
  24. {% endif %}
  25. {% if block.content %}
  26. <div class="panel__content">{{ block.content }}</div>
  27. {% elseif block.description %}
  28. <div class="panel__description">{{ block.description }}</div>
  29. {% endif %}
  30. </div>

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