drupal-menus

Automate Drupal menu configuration via YAML files and MenuTree API.

67|13|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/edutrul/drupal-ai --skill drupal-menus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drupal-menus
Source: https://github.com/edutrul/drupal-ai/tree/main/.claude/skills/drupal-menus
Command: npx skills add https://github.com/edutrul/drupal-ai --skill drupal-menus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing Drupal menus and their associated links (menu definitions, local tasks, actions, and contextual links) is often scattered across YAML files and custom code, leading to maintenance overhead and inconsistency.

Core Features & Use Cases

  • Define navigation via YAML files: links.menu.yml, links.task.yml, links.action.yml, and contextual links.
  • Programmatic menu tree loading, rendering, and alteration using Drupal's MenuTree API.
  • Extend with dynamic MenuLinkDefault plugins and hook-based alterations to adjust menu structures at runtime.
  • Programmatic manipulation of menus for custom modules and admin interfaces.

Quick Start

Create a module and declare its menus with my_module.links.menu.yml, my_module.links.task.yml, my_module.links.action.yml, and contextual.yml, then load and render the menu tree programmatically.

Frequently Asked Questions about drupal-menus

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define Drupal menu links in YAML files?

To define Drupal menu links in YAML, create links.menu.yml, links.task.yml, links.action.yml, and contextual links files within your custom module to declare navigation structures and local tasks consistently.

What is the best way to load and render a Drupal menu tree programmatically?

The best way to load and render a Drupal menu tree programmatically is using the MenuTree API to load, transform, and build render arrays for custom modules and admin interfaces.

How do I alter Drupal menu links at runtime?

You alter Drupal menu links at runtime by implementing hook-based alterations and extending dynamic MenuLinkDefault plugins to adjust menu structures dynamically during execution.

Does this approach support local tasks and contextual links in Drupal?

Yes, this approach fully supports local tasks and contextual links in Drupal by defining them through my_module.links.task.yml and contextual link YAML files for comprehensive navigation management.

When do I need custom YAML files for Drupal menus?

You need custom YAML files for Drupal menus when managing scattered menu definitions, local tasks, and actions across custom code, reducing maintenance overhead and ensuring configuration consistency.