- Issue created by @flyke
- Status changed to Needs review
10 months ago 12:19pm 10 July 2024 - 🇫🇷France andypost
Thank you! Great integration to add!
Let's get more opinions on a way to integrate, for example https://docs.gitlab.com/ee/administration/admin_area.html#user-impersona...+++ b/masquerade.module @@ -254,3 +254,20 @@ function masquerade_migration_plugins_alter(array &$migrations) { +function masquerade_preprocess_menu_region__footer(array &$variables): void { + if (\Drupal::service('masquerade')->isMasquerading()) { + $variables['items']['masquerade_switch_back'] = [ + 'title' => t('Unmasquerade'), + 'url' => Url::fromRoute('masquerade.unmasquerade'),
Curios if it needs cache metadata?!
Moreover we can display the block with quick links and so on.
Is there a way to configure how to display in navigation as I know nothing about it's API
- 🇧🇪Belgium flyke
I'm afraid I don't know much about the experimental Navigation module, but I am testing it out in a few projects to replace Gin Toolbar and Toolbar modules. I dumped all the $variables via hook_preprocess_navigation and hook_preprocess_navigation_menu and hook_preprocess_menu_region__footer but I see nothing about caching. Also missing is a 'weight' value or something, so adjusting the order is done by adjusting the order of the indexes in the ['items'] array itself.
So to answer your questions:
Curios if it needs cache metadata?!
I don't think that is something you can set in the Navigation itemsMoreover we can display the block with quick links and so on.
I'm not sure what you mean by this ?Is there a way to configure how to display in navigation as I know nothing about it's API
Not that I know, you just add an item to ['items'] that is an array like this:$variables['items']['navigation.my_views_page'] = [ 'is_expanded' => FALSE, 'is_collapsed' => FALSE, 'in_active_trail' => FALSE, 'title' => t('My view page'), 'url' => Url::fromRoute('view.mycustomview.page_&'), 'below' => [], 'class' => 'navigation_content', ];
The class decides the icon. So easiest is to use existing classes and icons. But I have created items with a custom class and attached a library to add a CSS to set custom icon for the custom class.
- 🇨🇷Costa Rica mcortes19
I added the masquerade cache context to the main region footer menu
- 🇧🇪Belgium svendecabooter Gent
Can this be implemented with the new hook_navigation_content_top - see [#3487802]?
- Status changed to Needs work
5 days ago 3:35pm 7 May 2025 - 🇨🇭Switzerland berdir Switzerland
What I just tested manually is that you can move the provided menu link to the navigation user links menu, and then it shows up there. I think this issue predates that this section is a menu, might only be in 11.1 or even 11.2
You only have one of those links though, and we also have sites where we have non-editor users without toolbar/navigation access and then we like to put the link into a frontend menu.
Maybe the module could provide an extra link for that menu if navigation is enabled in hook_menu_links_discovered_alter? that's similar to how navigation defines its own dynamic links.
- 🇦🇺Australia pameeela
Just hit this on a project yesterday, and I think it belongs in the navigation itself, not the top bar. And the user menu is a logical place. So +1 to #1!
Also was super confused by #7 because I could not find this menu, until I reread the comment, and yes, the user block isn't a proper menu until 11.2 :)