Admin Toolbar
Transforms the default Drupal Toolbar into an improved drop-down menu system, providing fast and full access to all administration links with configurable behavior and optional search functionality.
admin_toolbar
Install
composer require 'drupal/admin_toolbar:^3.6'
Overview
Admin Toolbar is a widely-used administration enhancement module that significantly improves the default Drupal Toolbar user experience. It transforms the standard administration menu into a hierarchical drop-down menu system, allowing site administrators to access all administrative pages quickly without multiple clicks or excessive scrolling.
The module maintains a lightweight footprint by closely integrating with Drupal core's Toolbar functionality. It provides configurable sticky behavior, hoverIntent support for smoother menu interactions, keyboard shortcuts for toolbar visibility, and adjustable menu depth settings. The module can be extended with its companion submodules to add additional functionality like cache flushing shortcuts, cron execution, and an autocomplete search field for finding administration pages.
Admin Toolbar is particularly valuable for content editors, site builders, and administrators who frequently access various administration pages throughout their workflow, dramatically reducing the time needed to navigate the Drupal admin interface.
Features
- Transforms the default Drupal Toolbar into a hierarchical drop-down menu with nested submenus for quick navigation
- Configurable sticky behavior with three options: always visible, hidden on scroll-down with show on scroll-up, or completely disabled
- hoverIntent jQuery plugin integration for smoother menu interactions, preventing accidental menu activations with configurable timeout settings
- Keyboard shortcut (Alt + p) to toggle toolbar visibility, with state persistence across page loads using localStorage
- Configurable maximum menu depth (1-9 levels) for controlling how many nested menu levels are displayed
- CSS icon classes automatically added to menu links based on their route names for visual customization
- Title attributes with link descriptions added to menu items for improved accessibility
- Automatic menu rebuilding when configuration changes are saved
Use Cases
Quick Cache Clearing During Development
During theme or module development, use Admin Toolbar Extra Tools to quickly clear specific caches (CSS/JS, Twig, Render, Theme registry) without clearing all caches. Hover over the Drupal icon, navigate to 'Flush all caches', and select the specific cache to clear. This saves significant time compared to clearing all caches.
Rapid Content Type Management
When managing multiple content types, use the dropdown menu to quickly access any content type's settings, field configuration, form display, or view display without navigating through multiple pages. Simply hover over Structure > Content types and select the desired content type and operation.
Finding Administration Pages with Search
Enable Admin Toolbar Search and use Alt+a to quickly focus the search field. Type partial page names like 'perf' to find Performance settings, or 'cron' to find cron-related pages. The autocomplete shows matching pages with their full menu path for context.
Maximizing Screen Real Estate
When editing content or working in full-screen mode, use Alt+p to hide the toolbar completely. A floating button appears in the corner to restore it. The preference persists across page loads, making it ideal for content-focused work sessions.
Managing User Roles and Permissions
Quickly navigate to any user role's edit form or permissions directly from People > Roles dropdown. Each role shows nested links for Edit permissions and Delete (for custom roles), eliminating multiple clicks through the roles listing page.
Running Cron and Updates
Access Run cron and Run updates links directly from the Drupal icon menu without navigating to the Status report. Useful for quick maintenance tasks or after deploying updates.
Tips
- Enable Admin Toolbar Extra Tools for the full experience with cache clearing, cron, and entity management shortcuts
- Use the Search feature (Alt+a) to quickly find any administration page without memorizing menu locations
- Set hoverIntent timeout to 500ms (default) for balanced responsiveness; increase if you frequently accidentally close menus
- Reduce menu depth to 3 or 4 if you have performance concerns with many nested menu items
- The toolbar visibility toggle (Alt+p) remembers your preference - useful for content editors who need maximum screen space
- Admin Toolbar automatically adds CSS classes based on route names, making it easy to add custom icons via CSS
- Local tasks display in Admin Toolbar Tools shows edit/delete tabs for the current entity in the toolbar for quick access
Technical Details
Admin Pages 3
/admin/config/user-interface/admin-toolbar
Main configuration page for the Admin Toolbar module. Allows administrators to configure the toolbar's sticky behavior, hoverIntent settings for hover interactions, keyboard shortcuts, and menu depth. Changes take effect immediately after saving and trigger a menu cache rebuild.
/admin/config/user-interface/admin-toolbar-tools
Configuration page for the Admin Toolbar Extra Tools submodule. Controls the number of entity bundles displayed in menus and whether local tasks (edit/delete tabs) are shown in the toolbar.
/admin/config/user-interface/admin-toolbar-search
Configuration page for the Admin Toolbar Search submodule. Controls the search field display mode and keyboard shortcut availability.
Permissions 1
Hooks 4
hook_toolbar_alter
Alters the toolbar render array to inject Admin Toolbar's pre-render callback and attach necessary JavaScript libraries based on configuration settings.
hook_toolbar
Implements hook_toolbar() to add toolbar items for Admin Toolbar Tools (extra links, local tasks) and Admin Toolbar Search (search field).
hook_entity_insert / hook_entity_update / hook_entity_delete
Triggers menu link rebuilding when entities that affect menu structure are created, updated, or deleted (menus, user roles, views, content type bundles).
hook_preprocess_menu
Used by Admin Toolbar Links Access Filter to hide menu links the current user doesn't have access to view.
Troubleshooting 6
Clear all caches (Admin > Flush all caches) and ensure JavaScript is not blocked. Check browser console for JavaScript errors. Verify the Toolbar module is enabled.
Try disabling hoverIntent in Admin Toolbar settings or adjusting the timeout value. Lower timeout values (250-500ms) provide snappier response.
Check for conflicts with browser extensions, accessibility tools, or other modules. Try disabling the shortcuts in settings if they conflict with essential functionality.
Adjust 'Maximum number of bundle sub-menus to display' in Admin Toolbar Tools settings. Default is 20; increase for sites with many content types or decrease for better performance.
Ensure the user has 'Use Admin Toolbar Search' permission. If using Admin Toolbar Tools, extra links are loaded via AJAX on first search - wait for the initial load to complete.
This submodule is deprecated for Drupal 10.3+. Uninstall it and rely on core's improved menu access handling instead.
Security Notes 5
- Admin Toolbar respects Drupal's permission system - users only see menu items they have access to (enhanced when using Links Access Filter submodule)
- Cache flushing and cron operations require 'administer site configuration' permission
- CSRF tokens protect all cache flush and cron routes from cross-site request forgery
- The search endpoint (/admin/admin-toolbar-search) requires 'use admin toolbar search' permission
- Never grant administration toolbar access to untrusted users as it provides quick access to powerful site operations