Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
markhalliwellAny empty items passed are automatically turned into dividers. See bootstrap_process_bootstrap_dropdown().
Comment #3
hass CreditAttribution: hass commentedThese fields in a menu item are required and cannot be empty:
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.
Comment #4
GrimreaperHello,
@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.
Comment #5
hass CreditAttribution: hass commentedI 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.
Comment #6
markhalliwell@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.
Comment #7
hass CreditAttribution: hass commentedYour 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?
Comment #8
markhalliwellComment #9
hass CreditAttribution: hass commentedAnswers are needed.
Comment #10
markhalliwellComment #11
hass CreditAttribution: hass commentedEveryone who has the same need, can give https://www.drupal.org/project/bootstrap_menu_items a try.
Comment #12
BEGRAFX CreditAttribution: BEGRAFX commentedQuestion 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?Comment #13
intrafusion@BEGRAFX you can add an empty menu item by putting
route:<nolink>
in the Link fieldComment #14
schneidolf CreditAttribution: schneidolf as a volunteer commented#4 without the
no-follow
class in combination with #13route:<nolink>
worked for me in D8.Comment #15
DanChadwick CreditAttribution: DanChadwick commentedJust to put a bow on this for D8, I'm using the following menu definition: