Can I set 'depth' => 3?
I want to show up-to depth 3 of sub menus. I use 'depth' => 3, but it cant works. Any suggestions.
Bootstrap 3 does not natively support more then two levels, so WP Bootstrap Navwalker is purposely limited to two levels. If you would like to have three levels you will have to modify the walker and Bootstrap's CSS.
Such modifications are outside of the scope of support with this script. On Jun 3, 2014 12:30 AM, "Mahesh Waghmare" [email protected] wrote:
I want to show up-to depth 3 of sub menus. I use 'depth' => 3, but it cant works. Any suggestions.
— Reply to this email directly or view it on GitHub https://github.com/twittem/wp-bootstrap-navwalker/issues/115.
Thanks...!
@maheshwaghmare did you manage a workable solution and if so do you might sharing it?
@wesweat If there is a solution it must be done modifying the behavior of Bootstrap and this nav-walker. At current versions Bootstrap only supports 2 deep drop down.
you are not supposed to have more than two level deep drop down menu, so i suggest you design your site around two level deep dropdown menu
just add into ur css: ul.dropdown-menu li > ul.dropdown-menu{ left: 100%; top: 0; }
and ul.dropdown-menu li:hover > ul.dropdown-menu, ul.dropdown-menu li:focus > ul.dropdown-menu{ display: block }
@dannio could you elaborate more on what the CSS does for anyone who needs to know? Where does the 1st and 2nd dropdowns appear?
I've used similar style rules before to make this happen as well but doing it this way forces the menu to work on :hover. Touch input users cannot hover.
The prefered way to make this happen would be to retain the parent's ability to be a tappable target and as such would need custom JavaScript to make it happen (as Bootstrap core doesn't support multi-level dropdowns at all).
ah my solution only works on non touch screens unfortunately. There's a script somewhere that adds and removes the open class from the main dropdown once you click off it. you'll have to find that and change it so it doesn't remove the open class when you click on a child item.
I ended up having to display a custom made mobile menu instead in the end as the client needed it done quickly and i didn't have time to shift through the code looking for it.
@dannio Thanks alot, your two line css code saved lot of time and energy. It really worked nicely. Thanks again.
Manish
This Blog post realy helped me out, blog post