I couldn't find any documentation about this on your site..

Example by official documentation:
http://getbootstrap.com/components/#dropdowns-divider

<ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
    <li><a href="#">Action</a></li>
    <li><a href="#">Another action</a></li>
    <li><a href="#">Something else here</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="#">Separated link</a></li>
</ul>

Thank you

Comments

kopeboy created an issue. See original summary.

markhalliwell’s picture

Status: Active » Closed (works as designed)

Any empty items passed are automatically turned into dividers. See bootstrap_process_bootstrap_dropdown().

hass’s picture

Version: 7.x-3.5 » 7.x-3.13
Status: Closed (works as designed) » Active

These fields in a menu item are required and cannot be empty:

  • Menu link title
  • Path

What module / code is required to accomplish this divider for normal users (not only by coding in a theme). This need to be managable by users.

Grimreaper’s picture

Hello,

@hass: I managed to have divider (in D8 at least) using the menu_attributes module https://www.drupal.org/project/menu_attributes

In "Menu item attributes": "classes" put "divider".
In "Menu link attributes": "relation" put "nofollow" and "classes" put "hidden"

I target my separator menu links to the front page.

If that can help.

hass’s picture

I try to understand for what module the theme code was written for... so it simply works without any big tricks. A comment in code should be added about this.

markhalliwell’s picture

Version: 7.x-3.13 » 7.x-3.5
Status: Active » Closed (works as designed)

@hass, this project was not "coded" for any particular module. It is not a module, it is a base theme. The only "UI" aspects it provides is theme settings, which obviously does not and cannot interact with UI menu construction.

hass’s picture

Status: Closed (works as designed) » Active

Your usless answer tell us nothing. Please provide answers that help users.

The theme implements a condition to check if $data is empty and in this case add's a divider CSS class. What module makes use of this condition? Core out of the box does not allow empty $data. special items does not, too. For what module was this condition implemented?

markhalliwell’s picture

Status: Active » Closed (works as designed)
hass’s picture

Status: Closed (works as designed) » Active

Answers are needed.

markhalliwell’s picture

Status: Active » Closed (works as designed)
hass’s picture

Everyone who has the same need, can give https://www.drupal.org/project/bootstrap_menu_items a try.

BEGRAFX’s picture

Question for @markcarver (or anyone, really)

I understand what @hass is saying. I've looked for the same sort of thing. I'll be taking a look at the menu attributes module; but I have thought myself, it would really just make things much easier if, for instance, in the Structure>Menus>Main Menu screen - right now, as @hass mentioned in #3, the path is a requirement - if, for example, we could give a # in the PATH space, (as we can do, for example, in Static HTML) and have that treated as a "Header" or "separator", that would be IDEAL. I recognize I'm largely off-topic here, and I apologize, but I'm wondering, how would we go about suggesting something like this be added to CORE?

intrafusion’s picture

@BEGRAFX you can add an empty menu item by putting route:<nolink> in the Link field

schneidolf’s picture

#4 without the no-follow class in combination with #13 route:<nolink> worked for me in D8.

DanChadwick’s picture

Just to put a bow on this for D8, I'm using the following menu definition:

MY_MENU_ID:
  route_name: <nolink>
  parent: MY_PARENT_MENU_ID
  weight: MY_WEIGHT
  options:
    wrapper_attributes:
      class:
        - divider