admin-block.html.twig
Same filename in this branch
Same filename in other branches
- 8.9.x core/themes/stable/templates/admin/admin-block.html.twig
- 8.9.x core/modules/system/templates/admin-block.html.twig
- 10 core/themes/stable9/templates/admin/admin-block.html.twig
- 10 core/modules/system/templates/admin-block.html.twig
- 11.x core/themes/stable9/templates/admin/admin-block.html.twig
- 11.x core/modules/system/templates/admin-block.html.twig
Default theme implementation 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/
modules/ system/ templates/ admin-block.html.twig
View source
- {#
- /**
- * @file
- * Default theme implementation 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.
- *
- * @ingroup themeable
- */
- #}
- {%
- set classes = [
- 'panel',
- ]
- %}
- <div{{ attributes.addClass(classes) }}>
- {% if block.title %}
- <h3 class="panel__title">{{ block.title }}</h3>
- {% endif %}
- {% if block.content %}
- <div class="panel__content">{{ block.content }}</div>
- {% elseif block.description %}
- <div class="panel__description">{{ block.description }}</div>
- {% endif %}
- </div>
Related topics
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.