New answers tagged navigation
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::...
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'
...
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
...
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'),
+ ...
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 ...
Top 50 recent answers are included
Related Tags
navigation × 16057 × 403
8 × 371
theming × 296
routes × 225
views × 176
nodes × 117
entities × 76
blocks × 74
users × 66
javascript × 52
hooks × 46
i18n-l10n × 46
taxonomy-terms × 38
media × 38
6 × 34
uri × 29
9 × 27
forms × 25
files × 24
ajax × 22
tokens × 18
path-aliases × 17
caching × 16
breadcrumbs × 14