Back to Menu Lists Support

jared.meyering
jared.meyering

Bootstrap requires dropdown menu items to have specific markup

<li class="dropdown">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
        Dropdown
    </a>
    <ul class="dropdown-menu">
      ...
    </ul>
</li>

From what I can tell I don't see the ability to add a class to the link target of the dropdown item, as well as the data-toggle attribute.

Last updated

Flynsarmy
Flynsarmy

Does before_url_item_label not do this?

jared.meyering
jared.meyering

Can that be granular enough to tackle only the elements which contain a dropdown? Looks to me like there is only one choice there which would apply to all elements.

Flynsarmy
Flynsarmy

Perhaps before_children is what you're after?

before_children='<a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown</a><ul class="dropdown-menu">'

Then simply add a 'dropdown' class to your top level element.

Last updated

jared.meyering
jared.meyering

before_children needs to contain

'<ul class="dropdown-menu">'

Should i have it contain the "a" tag also?

 ''<ul class="dropdown-menu"><a class="dropdown-toggle" data-toggle="dropdown" href="#">'

If it contains the "a" tag what happens to before_url_item_label? Would it not duplicate the "a"? I would need that to keep defaults for all the others.

Flynsarmy
Flynsarmy

You'll have to try it and see. I can't offer as high a level of support for my free plugins as I do for my paid unfortunately.

I'll look into drop downs in bootstrap at some point in the future.

jared.meyering
jared.meyering

Oh interesting. I see, thanks.

that0n3guy
that0n3guy

I've messed with this a little and I don't think this works. The closest I got was with before_item, but that doesn't work b/c the parent to be different than my child.

before_children might work, but it doesn't have any arguments (like parent title) to be able to do it right.

1-8 of 8