- Issue created by @flyke
- Status changed to Needs review
6 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