If you use route:<nolink> as a menu path, there is a discussion to change this slightly at #2698057: Add support for <nolink> and <none> to the LinkWidget UI

However, the output uses a <span> in place of an <a> and doesn't get displayed correctly. There is a workaround to set the path to something else, but it would be better if the span was styled similarly. The main issue is the padding.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

intrafusion created an issue. See original summary.

intrafusion’s picture

Issue summary: View changes
super_romeo’s picture

Version: 8.x-4.x-dev » 8.x-3.x-dev

Same thing in 8.x-3.x-dev.

super_romeo’s picture

FileSize
16.17 KB

This menu item is "span". If I change it manually to "a" it will be fixed.

Anatoliy Vorobyov’s picture

Drupal Bootstrap theme assume that there will be link: .nav > li > a

super_romeo’s picture

I know it, but what should we do?...

imclean’s picture

Fix it in your subtheme wherever your menu styles go. For example,

.nav > li > a,
.nav > li > span {
  // Menu item styles
}
super_romeo’s picture

Thank you @imclean, but this is a workaround, not a solution. I have no idea, how this case not has been resolved for years :) I'll create a patch today.

super_romeo’s picture

Status: Active » Needs review
FileSize
1.23 KB

Cache rebuild required.

markhalliwell’s picture

Version: 8.x-3.x-dev » 8.x-4.x-dev
Assigned: Unassigned » markhalliwell
Status: Needs review » Needs work

This project no longer adds styling components. It, instead, does that in https://github.com/unicorn-fail/drupal-bootstrap-styles.

Regardless, I doubt this is necessary. We should be able to just check for <nolink> and then add the navbar-text class to it accordingly.

markhalliwell’s picture

Assigned: markhalliwell » Unassigned
Status: Needs work » Fixed
FileSize
1.35 KB

  • markcarver committed 10f86fa on 8.x-4.x
    Issue #3053464 by markcarver, intrafusion: Menu path route:<nolink>...

  • markcarver committed 51bf137 on 8.x-3.x
    Issue #3053464 by markcarver, intrafusion: Menu path route:<nolink>...
super_romeo’s picture

FileSize
19.87 KB

Works, but there are some bugs:

pic
1. Text color is different.
2. Background color doesn't changes on hover.
3. Cursor doesn't changes on hover.

This is because in css uses tag (a), not class.
E.g.

.navbar-default .navbar-nav > li > a {
    color: #ffffff;
}

Want should I do?

super_romeo’s picture

Status: Fixed » Needs work
markhalliwell’s picture

Status: Needs work » Fixed

1. Text color is different.
2. Background color doesn't changes on hover.
3. Cursor doesn't changes on hover.

This is because in css uses tag (a), not class.

That's because when you use <nolink> it shouldn't output a link (hence the name).

So yes, the text, bg and cursor are different... as they should be.

If you want it to behave like a link, then populate it with a real link. Like to the landing page for that dropdown, presumably, so users without JS (who wouldn't see the dropdown) can get to the sub-menu links that way.

The code is already designed to handle dropdowns so it opens it instead of navigating to the actual link (this is the way Bootstrap is designed).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

DanChadwick’s picture

Whoops. Wrong issue.