New answers tagged

1 vote

Finding all nodes not referenced by a menu

In Drupal 9 can use this 'menu_link_content_data' table to find whether node has any reference as menu: Snippet code for finding all nodes not referenced by a// Get all nodes. $nids = \Drupal::...
mini's user avatar
  • 54
1 vote

How to show menu tab only for certain node type?

The code below work for me. in the routing.yml mymodule.cache_clear: path: '/node/{node}/cache' defaults: _form: '\Drupal\mymodule\Form\APICacheClearForm' _title: 'Cache Clear' ...
vinhdv's user avatar
  • 1,382
0 votes

How to show menu tab only for certain node type?

Is it not possible to accomplish this without using _custom_access? The other alternative is: mymodule.links.task.yml mymodule.cache_clear: title: 'Cache Clear' route_name: mymodule.cache_clear ...
No Sssweat's user avatar
0 votes

menu.tree_storage service is missing from my site

In case this helps someone else: Since we only use the load method of the MenuTreeStorage class, we were able to replace it with the MenuLinkManager. - $container->get('menu.tree_storage'), + ...
Jelle's user avatar
  • 458
0 votes

How to get translated menu link entity

It seems like you're building a custom solution to generate menu items for a headless Drupal site, and you're encountering difficulties with retrieving translated menu labels. In Drupal 9, using the ...
Z CHAMP's user avatar
  • 32

Top 50 recent answers are included