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

Multi-level?

Open ghost opened this issue 13 years ago • 6 comments

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.

ghost avatar Aug 30 '13 13:08 ghost

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.

SideQuestDIY avatar Aug 30 '13 14:08 SideQuestDIY

My bad. Thanks for this great walker.

ghost avatar Aug 30 '13 14:08 ghost

No problem, i'm glad you found it useful :)

SideQuestDIY avatar Aug 30 '13 14:08 SideQuestDIY

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.

ghost avatar Sep 03 '13 14:09 ghost

I was actually just tweaking that very thing. The script has been updated to fix the caret and extra class declaration issue.

SideQuestDIY avatar Sep 03 '13 14:09 SideQuestDIY

Hi, The script working for desktop but not on mobile, is there any fix

Thanks

sigmakumarwadbude avatar Aug 05 '15 13:08 sigmakumarwadbude