Drupal is a registered trademark of Dries Buytaert
Menu Per Role 8.x-1.9 Minor update available for module menu_per_role (8.x-1.9). Google API PHP Client 8.x-4.8 Minor update available for module google_api_client (8.x-4.8). GEO Starter JSON-LD 1.1.1 Minor update available for module geo_starter_jsonld (1.1.1). SQLite VDB Provider 1.4.0 Minor update available for module ai_vdb_provider_sqlite (1.4.0). SQLite VDB Provider 1.3.0 Minor update available for module ai_vdb_provider_sqlite (1.3.0). Burndown 1.0.70 Minor update available for module burndown (1.0.70). Webform MailerLite integration 1.0.4 Minor update available for module webform_mailerlite (1.0.4). Select Icons 2.1.0 Minor update available for module select_icons (2.1.0). Menu Per Role 2.0.0 Module menu_per_role updated after 7 months of inactivity (2.0.0). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module automatically hides parent menu items that lead to no accessible child links for the current user. This keeps navigation menus clean by preventing placeholder items like "Create" or "Settings" from appearing if the user lacks permissions for any sub-items.

Menu Hide Parent automatically hides placeholder parent menu items (such as those using or routes) when they have no visible child links after access checks.

This ensures that top-level items like Create, Manager, or Settings do not appear in navigation menus when users don’t have permission to access any of their sub-items — keeping menus clean, contextual, and role-aware.

Features

  • Automatically hides parent menu items using or targets when they have no accessible children.
  • Respects role-based and permission-based access controls.
  • Cache-safe, runs only on menu tree rebuilds, not every page load.
  • Per-menu enable/disable configuration via the admin UI.

Configuration

  • Go to Configuration → User Interface → Menu Hide Parent (/admin/config/user-interface/menu-hide-parent).
  • Check the menus where you want to hide empty placeholder parent items.
  • Save configuration.
  • (Optional) Grant the Administer Menu Hide Parent settings permission to trusted site builders.

Use Cases

  • Hiding “Create” or “Manager” menu headers when users can’t create or manage any content types.
  • Preventing empty parent items from cluttering navigation for restricted roles.

Technical Notes

  • Implements hook_menu_tree_alter() to prune menu trees at render build time.
  • Adds user.roles as a cache context for per-role variants.
  • Fully compatible with cached menu rendering and configuration-managed menus.

Activity

Total releases
3
First release
Apr 2026
Latest release
1 month ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.1.0-alpha3 Pre-release May 20, 2026
1.1.0-alpha2 Pre-release Apr 20, 2026
1.1.0-alpha1 Pre-release Apr 20, 2026