Menu & Sidebar

The AdminLTE sidebar is fed by Drupal menus. The theme ships the Administration menu block and the Main navigation block in the sidebar region, rendering each as a collapsible AdminLTE treeview with per-section icons and automatic active-trail highlighting.

Which menus appear

The default block placement (config/install) puts two menu blocks in the sidebar:

BlockDrupal menuTemplate
Administrationsystem.menu.adminmenu--admin.html.twig
Main navigationsystem.menu.mainmenu--main.html.twig
User account menusystem.menu.accountmenu--account.html.twig (navbar)

The Administration block is configured with level: 1, depth: 3 and expand_all_items: true, so the full admin tree is available in the sidebar.

How the treeview renders

The sidebar menu templates emit AdminLTE's .sidebar-menu structure. Each item with children gets a .nav-treeview submenu and a dedicated chevron toggle button — so clicking the label navigates to the section page while clicking the chevron expands/collapses the submenu in place:

<li{{ item.attributes.addClass(li_classes) }}>
  <a href="{{ item.url }}" class="{{ link_classes|join(' ')|trim }}">
    <i class="nav-icon bi {{ item.icon|default('bi-record-circle') }}" aria-hidden="true"></i>
    <p>{{ item.title }}</p>
  </a>
  {% if item.below %}
    <button type="button" class="nav-treeview-toggle"
            aria-expanded="{{ item.in_active_trail ? 'true' : 'false' }}">
      <i class="nav-arrow bi bi-chevron-right" aria-hidden="true"></i>
    </button>
    {{ menus.menu_links(item.below, attributes, menu_level + 1) }}
  {% endif %}
</li>

Section icons

adminlte_preprocess_menu__admin() promotes the Administration menu's children (Content, Structure, …) to the top level and maps each top-level section to a Bootstrap icon by route:

RouteIcon
system.admin_contentbi-file-earmark-text
system.admin_structurebi-diagram-3
system.themes_pagebi-palette
system.modules_listbi-puzzle
system.admin_configbi-gear
entity.user.collectionbi-people
system.admin_reportsbi-graph-up

Active trail

Items in Drupal's active trail receive AdminLTE's active and menu-open classes server-side. In addition, the adminlteSidebarActive behaviour in adminlte-drupal.js resolves the current page client-side by longest-matching path and opens every ancestor section — robust across menus where the server-side active trail is not always populated for the active block.

To add your own menu to the sidebar, create or pick a menu at /admin/structure/menu, then place its block in the Sidebar region at /admin/structure/block. It inherits the AdminLTE treeview styling automatically. For per-item icons on a custom menu, copy the icon-mapping pattern from adminlte_preprocess_menu__admin() into your sub-theme.


AdminLTE 4 · Drupal port Edit on GitHub