How to unfold the Olivero Drupal 9 themed main menu on mobile ?

I have a Drupal 9 website with the default Drupla Olivero theme. When the navigation switches to mobile menu, I want the main menu to be unfolded. I need pure JS code. Drupal 9 no longer supports jQuery.

Here is the main menu collapse :

https://i.stack.imgur.com/0Yd2h.png

Here is the main menu unfold :

https://i.stack.imgur.com/TecB9.png

How do I show a shadow under the Olivero mobile navbar ?

I activated the Olivero theme on Drupal 9.

I added the following code to my stylesheet to pin the navigation bar in mobile mode :

.site-header {
    z-index: 111;
    position: sticky;
    top: 0;
}

@media (min-width: 75rem) {
  body:not(.is-always-mobile-nav) .site-header {
    position: relative;
  }
}

Now I want to show a shadow below the navigation bar, when it is in mobile mode. I want the shadow to appear only when the user scrolls down the page. If down 1 pixel, the shadow should appear.

How to unfold the main menu on mobile with Olivero ?

On Drupal 9, I have the Olivero theme. When the navigation switches to mobile mode, you have to go to the + button opposite the menu to display the sub-menu. It's not intuitive, because the user has to perform an additional action. I would like to unfold the main menu when the navigation switches to mobile mode.

https://www.drupal.org/files/issues/2022-06-07/Screenshot_20220606-17234...

How do I sort view results by proximity ?

I have a Drupal 9 website and the Geolocation Field module.

I created a view to show the nodes. My node type contains a "Geolocation" field.

I added to the view a "Filtering criteria" with "Content: Geolocation - Proximity (exposed)".

How do I sort view results? I want nodes to be displayed by creation date by default. I want if the user enters an address in the exposed filter, the nodes are sorted by proximity (nearest to farthest).

Want to create a variable for menu.html.twig

Hi Guys, 

I want a variable in menu.html.twig file but it is not working for me. 

I have tried this: 

This function I have written in my theme's .theme file 

/**
 * @param $variables
 */
function my_theme_name_preprocess_menu(&$variables)
{
    $account = \Drupal::currentUser();
    $variables['current_username'] = $account->getDisplayName();
}

And I am calling this variable in menu.html.twig file like this: 

"Package symfony/debug is abandoned"

I'm trying to upgrade a site from 8.9.20.  When I go to the Unix command line and run 

composer update "drupal/core-*" --with-all-dependencies

I get this feedback.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x