You are here

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

Seven's theme implementation for the content of an administrative block.

Uses unordered list markup in both compact and extended modes.

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/themes/seven/templates/admin-block-content.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Seven's theme implementation for the content of an administrative block.
  5. *
  6. * Uses unordered list markup in both compact and extended modes.
  7. *
  8. * Available variables:
  9. * - content: List of administrative menu items. Each menu item contains:
  10. * - link: Link to the admin section.
  11. * - title: Short name of the section.
  12. * - description: Description of the administrative menu item.
  13. * - url: URI to the admin section.
  14. * - options: URL options. See \Drupal\Core\Url::fromUri() for details.
  15. * - attributes: HTML attributes to be added to the element.
  16. * - compact: Boolean indicating whether compact mode is turned on or not.
  17. *
  18. * @see template_preprocess_admin_block_content()
  19. * @see seven_preprocess_admin_block_content()
  20. */
  21. #}
  22. {%
  23. set classes = [
  24. 'admin-list',
  25. compact ? 'compact',
  26. ]
  27. %}
  28. {% if content %}
  29. <ul{{ attributes.addClass(classes) }}>
  30. {% for item in content %}
  31. <li><a href="{{ item.url }}"><span class="label">{{ item.title }}</span><div class="description">{{ item.description }}</div></a></li>
  32. {% endfor %}
  33. </ul>
  34. {% endif %}