bootscore / bootscore

Flexible Bootstrap WordPress starter theme with full WooCommerce support and built-in SCSS compiler.
https://bootscore.me
MIT License
311 stars 92 forks source link

Mega menu #162

Closed lennertfabriek closed 2 years ago

lennertfabriek commented 2 years ago

Hi Basti,

Is it possible to create a mega menu with the existing navwalker?

lennertfabriek commented 2 years ago

For now I created a custom div with display none and get visible when hovering. (website.oneshot.nl). Is there a better solution or is this okay?

crftwrk commented 2 years ago

Hi Lennart,

not so easy because nav-walker follows straight Bootstrap way and this means:

But it's possible with some custom coding. A good source with some examples and snippets is https://bootstrap-menu.com.

There are some discussions on nav-walker issues about this too https://github.com/AlexWebLab/bootstrap-5-wordpress-navbar-walker/issues/19, https://github.com/AlexWebLab/bootstrap-5-wordpress-navbar-walker/issues/26.

The nav-walker is a pluggable function in functions.php. So you can override this file safely in your child.

There is also a mega menu nav-walker available https://github.com/wp-bootstrap/WP-Bootstrap-MegaMenu-Navwalker. It's not tested and still Bootstrap 4, but changing data-toggle to data-bs-toggle should work for Bootstrap 5.

Your solution is ok, but there problems on mobile. Maybe adjust them via media-queries? What's about to hard-code it without the nav-walker?

Does this help?

lennertfabriek commented 2 years ago

Hi!

I get it. Hard coded menu is an idea but I like the current one. Then I prefer my solution for now, this one is also customizable at any wishes. For mobile I just want to use another menu without drop down.

Thank you Basti.

crftwrk commented 2 years ago

You‘re welcome👍