Motivation
Creating a site's primary navigation is one of the most time-consuming parts of creating a Drupal site. The primary nav needs to function both in desktop and mobile mode.
Tasks
Bring Olivero's basic menu into starterkit theme.
To decide
Should this be behind a theme setting?
If so, should it be enabled by default?
Issue fork drupal-3301623
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mherchelWide menu is functioning. Still need to work on mobile menu.
Assigning to myself. I plan to work on this through the next week or two.
Comment #4
mherchelThis should be close to ready (lets see if tests pass). Reviews welcome (even if tests do not pass).
Comment #5
mherchelTests are failing because of #3304731: Update remaining tests using Classy to use Starterkit
Comment #6
mherchelPer @lauriii in https://drupal.slack.com/archives/C0D5GJZ8B/p1664283312014609,
Comment #7
corn696Hi,
I am trying to integrate the olivero menu into our existing custom theme.
I thought this might be helpful to see what files are needed.
So i tried this out.
But it doesn't seem to work. The icons for submenus are there, but there is no hover functionality on desktop and the + icon on mobile has no function either.
Just for interest, was there a discussion about a (contrib) module solution for the olivero menu?
I would guess, it's probably not an uncommon use case that someone wants to use the olivero menu with their existing theme.
Comment #8
mherchelMake sure the "Expand all menu links" checkbox is selected within the block settings for the main navigation block (and the
"number of levels to display" is set to at least 2).
I'm willing to help out on a contrib solution for an olivero-like menu, but I don't have the personal bandwidth to do it on my own.
Comment #9
corn696Thanks for the quick response.
The checkbox is checked and number of levels to display is set to 2.
When I uncheck the box or set the level to 1, the arrow/plus icons disappear.
Comment #10
mherchelAre there any messages in the browser JS console?
Comment #11
corn696No messages.
Comment #12
mherchel🤔
Does it work when you disable JS (There's special styles for it there)?
Does the markup contain the submenus (inspect via devtools, there should be a nested
<ul>element.Is the JS loaded? Look in the source for main-menu.js
I'm assuming that you applied the diff from above right?
Comment #13
corn696Dropdown on desktop works. But the plus sign on mobile has still no function.
Yes.
Yes, when i disable "Aggregate JavaScript files".
I cloned the issue fork and the last shown commit is "No more JS build step."
Btw. the dropdown of the olivero theme is working but the mobile hamburger toggle throws an error:
The hamburger toggle is not present in the generated starter theme.
Comment #14
smustgrave commentedMR is behind a little bit but appears there are failures from the last commit.
Comment #15
mherchelFixed nightwatch tests. Lets see if this comes up green.
Comment #16
smustgrave commentedSeems there some failures in the last commit.
Can re-test after those.
Comment #19
gauravvvv commentedLeaving to NW as tests still needs to be added