ワンクリックで
drupal-menus
Drupal menus — links.menu.yml, links.task.yml, links.action.yml, contextual links, and programmatic menu manipulation.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Drupal menus — links.menu.yml, links.task.yml, links.action.yml, contextual links, and programmatic menu manipulation.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
HTMX in Drupal 11.3+ core — the Htmx PHP fluent builder, dynamic forms with swapOob, partial routes with _htmx_route, response headers, and Drupal.behaviors integration. Use when building interactive UI without full-page reloads using Drupal's native HTMX support.
DDEV local development expertise. Use when working with DDEV projects, containers, configuration, or troubleshooting DDEV environments.
Custom Docker Compose local development patterns. Use when working with Docker-based local environments, container configuration, or troubleshooting Docker setups.
Drupal access control — permissions.yml, access callbacks, AccessResult, custom access checkers, and entity access.
Drupal Cache API — cache tags, contexts, max-age, cache bins, invalidation, and adding cache metadata to render arrays.
Drupal Composer management — requiring modules, updates, patches via composer-patches, and version constraints.
| name | drupal-menus |
| description | Drupal menus — links.menu.yml, links.task.yml, links.action.yml, contextual links, and programmatic menu manipulation. |
# my_module.links.menu.yml
my_module.admin:
title: 'My Module'
description: 'Configure My Module.'
route_name: my_module.admin
parent: system.admin_config
weight: 10
my_module.admin.settings:
title: 'Settings'
route_name: my_module.admin.settings
parent: my_module.admin
weight: 0
# my_module.links.task.yml
my_module.settings_tab:
title: 'Settings'
route_name: my_module.admin.settings
base_route: my_module.admin
my_module.advanced_tab:
title: 'Advanced'
route_name: my_module.admin.advanced
base_route: my_module.admin
weight: 10
# my_module.links.action.yml
my_module.add_item:
title: 'Add Item'
route_name: my_module.add
appears_on:
- my_module.list
use Drupal\Core\Menu\MenuTreeParameters;
$menu_tree = \Drupal::menuTree();
$parameters = new MenuTreeParameters();
$parameters->setMaxDepth(2)->onlyEnabledLinks();
$tree = $menu_tree->load('main', $parameters);
$manipulators = [
['callable' => 'menu.default_tree_manipulators:checkAccess'],
['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
];
$tree = $menu_tree->transform($tree, $manipulators);
$build = $menu_tree->build($tree);
#[Hook('menu_links_discovered_alter')]
public function menuLinksDiscoveredAlter(array &$links): void {
if (isset($links['my_module.some_link'])) {
$links['my_module.some_link']['title'] = new TranslatableMarkup('New Title');
}
}
// src/Plugin/Menu/MyDynamicMenuLink.php
use Drupal\Core\Menu\MenuLinkDefault;
final class MyDynamicMenuLink extends MenuLinkDefault {
public function getTitle(): string {
return 'Dynamic Title from ' . $this->getRouteName();
}
}