Problem/Motivation
Any menu block should function in the primary menu region, but custom menus don't behave like the primary menu when placed in this region. I've tested with Barrio and Barrio Subtheme and the behavior is the same in both themes, so it does not appear to be a subtheme issue.
Steps to reproduce
- Install Bootstrap Barrio.
- Create a new menu at admin/structure/menu/add.
- Add multiple links to the menu.
- Move a link beneath a parent, and set the parent link to "expanded."
- Put the menu block in the theme's primary menu region. The whole menu shows as expanded instead of showing a dropdown for the parent.
Proposed resolution
Not sure
Remaining tasks
Not sure
User interface changes
Not sure
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2021-11-22 14_46_33-Window.png | 3.97 KB | ElToundriko |
Comments
Comment #2
ElToundriko commentedHello,
Same issue here with bootstrap_barrio 5.5.4 on Drupal 9.2.9.
Steps to reproduce:
Result:
the UL bubbles are visible. (see attachment)
Code inside mymodule.links.menu.yml :
Comment #3
hatuhay commentedThe new menu at least should have same structure/markup as the original main menu
Comment #4
ElToundriko commentedThanks to your advice, it now works ! I noticed from twig debug mode that the template loaded was menu.html.twig.
Here is what I've done :
Thank you @hatuhay , hope it helps the reporter of the bug.
Comment #5
hatuhay commentedThis is not a bug, please do not recategorize this.
Comment #6
potassiumchloride commentedThanks @hatuhay and @ELToundriko.
I followed these steps
And now my new subtheme does have a mymenu and top level items display the dropdown carrot. That is excellent.
However, the mymenu had the same problem as Issue 3223479 where the dropdown did not work. I was baffled because I copied the twig file (as outlined in #1 above) from Barrio 5.5.4, and I'm using the main menu in the site's default subtheme and that main menu works properly there.
Investigation showed that if the Load Library settings at /admin/appearance/settings/newsubtheme are set to any CDN or other library other than -None- then the dropdown menu for mymenu does not work in that new subtheme. This is not true for the main menu, which is displayed in the default subtheme that uses a Bootswatch library. If I set the Load Library to -None- in this new subtheme, then the custom mymenu dropdowns work.
Any ideas as to why loading a library in the new subtheme would prevent the mymenu from working, when using a library in the default subtheme with the main menu does work?
Comment #7
potassiumchloride commentedUpdate: The libraries in the /subtheme folder in the barrio module are not the same version of Bootstrap as the libraries in the bootstrap_barrio.libraries.yml file. Changing the Bootstrap version to be the same in both bootstrap_barrio.libraries.yml and bootstrap_barrio_SUBTHEME.libraries.yml worked and the drop-down menu works with a CDN.