wp-bootstrap-navwalker icon indicating copy to clipboard operation
wp-bootstrap-navwalker copied to clipboard

Support for Additional Levels of Dropdown Menu

Open pattonwebz opened this issue 11 years ago • 6 comments

This walker class intends not to modify, extend or override core Bootstrap in any way.

A decision was made with the release of Bootstrap 3 to only support a single level of dropdown in core meaning that this walker installed with out-of-the-box Bootstrap styles and scripts will not handle more than a single dropdown level.

Full support for additional dropdown levels require additional style rules and possible overrides to core Bootstrap functions that deal with nav menus.

That being said there have been many requests over time to support additional levels and as such I want to explore the options available to do that in this ticket.

A list of ideas/needs/notes will be kept at this (gist)https://gist.github.com/pattonwebz/54a87403e47c3d3f7018].

pattonwebz avatar Aug 07 '15 22:08 pattonwebz

Some ideas discussed in this issue: #176

pattonwebz avatar Aug 07 '15 22:08 pattonwebz

Hey @pattonwebz,

I am deep into a new version of the walker for Bootstrap 4, that also includes custom menu fields for things such as glyphicons so its not a hack way of doing it. One of my issues with adding is that everyone wants something else, multi-level, drop-down on hover, different icon options...

With the single file there has been such an extreme level of support and misunderstanding despite existing documentation, I fear adding more levels of complexity. I have been looking at way to extend the walker with add-on's but at that point its no longer a walker and it almost needs to be a full fledged bootstrap plugin and not a theme integration.

I would love to know your thoughts on this.

SideQuestDIY avatar Aug 31 '15 16:08 SideQuestDIY

Hey @twittem,

Glad that your already working on a Bootstrap 4 version, I'm about to update a few projects to use the new alpha and a working navwalker class would speed up the transition nicely :) Is there a development branch due to be pushed here soon? One user already opened a # pull request with a modified version of the existing walker that works with the latest alpha. It may be worth checking

I agree that even with the existing documentation (that I do think is sufficient) there are still a lot of misconceptions about what this does and how it works. Part of me says to simply it farther but I honestly can't see any sane way of doing that without growing the project into something much more than a walker.

Usage of the walker seems to be fine and understood by most - it's the behavior of the menu (the actual Bootstrap part) that people seem to have issues understanding. Part of that may be bad documentation on Bootstraps end but I think the docs they have do cover everything that is needed to know.

I very much feel like a walker that supports core Bootstrap 4 is what should be built and supported - even if that includes some nuances or counter-intuitive behaviors that lead to misunderstanding about what the walker does (I'm looking at you 'no-multi-level-dropdowns' lol!).

A BS4 walker that works essentially the same as the current one does (but without the hackish way of parsing out classnames from title attributes) would be where I'd place my vote - over a version that included a lot of additional functionality and complexity that is.

Having much more than a walker pushes it into borderline plugin territory and if we were to go down that road we'd likely want to think about what else to include. Why not include a class that builds and displays modals, tooltips, notifications. Those may all be possible by outputting markup + data-* attributes but we might need to also include custom JavaScript. Or create those scripts on-the-fly... All of that is vastly more complicated that a walker and would definitely merit it's own separate project. And FYI if you were to start a project like that I would certainly want to contribute :)

pattonwebz avatar Aug 31 '15 19:08 pattonwebz

I'd second that multi-level menu would be very useful for many people. Making a clean and organized UI would be much simpler.

akostadinov avatar Feb 19 '17 08:02 akostadinov

If this is still being considered, I would also find multi-level menus helpful.

arnoldNuvisto avatar Aug 08 '17 15:08 arnoldNuvisto

@arnoldNuvisto it's been a long time since there has been movement on multi-level support. Over many years almost every time I've looked at having proper support for this it's always resulted in modifications to BS JavaScript or many CSS overrides. Really a walker should not be adjusting CSS and JS code provided from upstream.

There has been ideas to bundle the walker into a plugin several times over the years as well. A plugin that bundles the walker would easily be able to include the modifications required to make multi-level menus work if that was what was truly wanted (note that BS core dev team decision is that only a single level is supported). If you decide to pursue that idea let me know and I'll lend support wherever I can.

Since this is a very old issue I am going to close it out but if anyone involved has anything additional to add please do so and I will reopen the issue.

pattonwebz avatar Aug 31 '17 16:08 pattonwebz