Open yorkshire-pudding opened 2 years ago
I am trying to achieve a similar result.
I would like this layout in the header, but with a dropdown menu for primary navigation. The header block would be great, if I could enable dropdown menu there.
I'm not sure how else to achieve this without custom theming (bummer).
Another example: https://ashefarmersmarket.com/
Hello I am a contributer at openforce 2022. Shall I work on this if its still open?
Hi @Girlwithasmile - Any that are open, unless there is a comment suggesting someone is actively working on it then is fine to look at.
Just a confusion, where is the dropdown menu needed? In the actual site or the site user will prepare?
Hi @Girlwithasmile
The header block, which also contains logo, sitename, slogan if applicable also has the option to contain a menu. However, that menu will never be a dropdown.
...In the actual site or the site user will prepare?
@Girlwithasmile to supplement what @yorkshire-pudding said above, and to specifically answer your question, when you install a fresh Backdrop site the header block is configured to hold the "Account menu". That menu has the following links available out of the box (see /admin/structure/menu/manage/user-menu
):
All these links are on the same level, whereas if you check another menu, like the administration menu (/admin/structure/menu/manage/management
), you will see that it has multiple links in various levels. When a top-level menu item has "children" menu items and you hover over it, it gets automatically expanded, to reveal the children menu items.
If you add some children menu items to the "Account menu" menu, you will notice that these menu items are not shown when you hover over their "parent" menu item - this is the problem we are trying to solve here. So I would suggest that after you have added some menu items with children items in the "Account menu" menu, you then work towards making it so that hovering over menu items reveals their children.
I hope this helps.
@Girlwithasmile - Any questions? We have office hours this week, if you need help: https://backdropcms.org/news/events/office-hours-2
I'm not sure this is a good candidate for core, but I'd love to see it evolve as a contrib module.
I could see the module adding settings into the header block that match the settings in the menu block.
Then in X_preprocess_header()
we'd override the variable $variables['menu']
so instead of calling
$variables['menu'] = $menu ? theme('links__header_menu', array('links' => $menu)) : NULL;
we call menu_tree_output()
to generate the menu markup like we do in system_menu_block_build()
There was a Forum question about this. https://forum.backdropcms.org/forum/dropdown-issues-bootstrap-5-lite
Was there any progress adding this functionality as contrib? @jenlampton's suggestion seems promising.
I have created a simple module to allow site builders to select dropdown style for the header block menu.
https://backdropcms.org/project/header_dropdown_menu
and
@argiepiano The header_dropdown_menu works great. I used a direct download of the latest code.
@argiepiano and anyone else interested, I just opened a new issue on that module, https://github.com/backdrop-contrib/header_dropdown_menu/issues/1
Description of the need There are some genuine use cases where drop down menus are needed for a site's primary navigation but for a given theme, the best place for a menu is as part of the header block, either for the look or because the primary navigation block doesn't work well in that theme.
Proposed solution It would be good to enable the menu in the "Header block" to be a dropdown menu.
Alternatives that have been considered Some themes work quite well with having a primary navigation block in the header and the menu disabled in the header block.
Is there a Drupal or Backdrop contributed module that accomplishes this? Not aware