Multi-level?
Anything specific I need to do for multi-level menus? My menu can sometimes be 3 levels deep, but this walker seems to be stuck at 2.
Hey @veryaca,
As mentioned in the readme, Bootstrap 3 only supports one level of drop down. They did this because of the mobile first nature of the new release, and consequently the walker only supports one level of dropdown as well. The walker is intended to implement Bootstrap 3 not extend the functionality so are no plans to add additional levels.
My Recommendations If you cannot simplify your menus structure in its current state the walker does still output the code for the dropdowns, so you may want to look at integrating the dropdown methods from Bootstrap 2.3.2
Alternately you can use Bootstrap 2.3.2 with the legacy version of the walker class found here (https://gist.github.com/twittem/6358588) it supports as many levels as you need.
My bad. Thanks for this great walker.
No problem, i'm glad you found it useful :)
Since bootstrap only supports one level of drop down, you should change line 119 from:
$item_output .= ($args->has_children) ? ' ' : '';
to:
$item_output .= ($args->has_children && $depth < 1) ? ' ' : '';
Or else, it adds a caret after the menu title in the dropdown and can confuse people. Just an opinion.
I was actually just tweaking that very thing. The script has been updated to fix the caret and extra class declaration issue.
Hi, The script working for desktop but not on mobile, is there any fix
Thanks