You are here

admin-block-content.html.twig in Drupal 9

Default theme implementation for the content of an administrative block.

Available variables:

  • content: List of administrative menu items. Each menu item contains:

    • link: Link to the admin section.
    • title: Short name of the section.
    • description: Description of the administrative menu item.
    • url: URI to the admin section.
    • options: URL options. See \Drupal\Core\Url::fromUri() for details.
  • attributes: HTML attributes to be added to the element.
  • compact: Boolean indicating whether compact mode is turned on or not.

File

core/modules/system/templates/admin-block-content.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the content of an administrative block.
  5. *
  6. * Available variables:
  7. * - content: List of administrative menu items. Each menu item contains:
  8. * - link: Link to the admin section.
  9. * - title: Short name of the section.
  10. * - description: Description of the administrative menu item.
  11. * - url: URI to the admin section.
  12. * - options: URL options. See \Drupal\Core\Url::fromUri() for details.
  13. * - attributes: HTML attributes to be added to the element.
  14. * - compact: Boolean indicating whether compact mode is turned on or not.
  15. *
  16. * @see template_preprocess_admin_block_content()
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. {%
  22. set classes = [
  23. 'list-group',
  24. compact ? 'compact',
  25. ]
  26. %}
  27. {% if content %}
  28. <dl{{ attributes.addClass(classes) }}>
  29. {% for item in content %}
  30. <dt class="list-group__link">{{ item.link }}</dt>
  31. {% if item.description %}
  32. <dd class="list-group__description">{{ item.description }}</dd>
  33. {% endif %}
  34. {% endfor %}
  35. </dl>
  36. {% endif %}

Related topics