Active
Project:
Superfish Dropdown Menu
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2026 at 08:22 UTC
Updated:
29 Jan 2026 at 08:25 UTC
Jump to comment: Most recent
Superfish menu block allows menu tree to be altered/manipulated by core and contrib manipulators.
Here's the code:
$tree = $this->menuTree->load($menu_name, $parameters);
$manipulators = [
['callable' => 'menu.default_tree_manipulators:checkAccess'],
['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
];
if ($this->moduleHandler->moduleExists('translatable_menu_link_uri')) {
$manipulators[] = ['callable' => 'superfish.translatable_menu_link_manipulator:transform'];
}
// Alter tree manipulators.
$this->moduleHandler->alter('superfish_tree_manipulators', $manipulators, $menu_name, $tree);
if ($this->moduleHandler->moduleExists('menu_manipulator')) {
$manipulators[] = ['callable' => 'menu_manipulator.menu_tree_manipulators:filterTreeByCurrentLanguage'];
}
$tree = $this->menuTree->transform($tree, $manipulators);
Manipulating the tree can be expensive and it happens on every page load, which might not be necessary.
Cache the menu tree.
Caching it directly might not be the best idea. We might provide a config that enables user to cache the menu tree.
Discuss and fix.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dipakmdhrm commentedI've added a PoC MR.