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

Can I set 'depth' => 3?

Open maheshwaghmare opened this issue 12 years ago • 10 comments

I want to show up-to depth 3 of sub menus. I use 'depth' => 3, but it cant works. Any suggestions.

maheshwaghmare avatar Jun 03 '14 06:06 maheshwaghmare

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.

SideQuestDIY avatar Jun 03 '14 06:06 SideQuestDIY

Thanks...!

maheshwaghmare avatar Jun 03 '14 07:06 maheshwaghmare

@maheshwaghmare did you manage a workable solution and if so do you might sharing it?

wesweat avatar Mar 30 '15 17:03 wesweat

@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.

LouisMilotte avatar Mar 30 '15 18:03 LouisMilotte

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

ghost avatar Mar 30 '15 22:03 ghost

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 avatar Aug 21 '15 02:08 dannio

@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).

pattonwebz avatar Aug 31 '15 19:08 pattonwebz

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 avatar Sep 01 '15 01:09 dannio

@dannio Thanks alot, your two line css code saved lot of time and energy. It really worked nicely. Thanks again.

Manish

msatpal avatar Sep 29 '15 07:09 msatpal

This Blog post realy helped me out, blog post

AssessmentDay avatar Mar 02 '17 15:03 AssessmentDay