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.
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.
Comment | File | Size | Author |
---|---|---|---|
#14 | screenshot.png | 19.87 KB | super_romeo |
#11 | 3053464-11.patch | 1.35 KB | markhalliwell |
Comments
Comment #2
intrafusionComment #3
super_romeo CreditAttribution: super_romeo as a volunteer commentedSame thing in 8.x-3.x-dev.
Comment #4
super_romeo CreditAttribution: super_romeo as a volunteer commentedThis menu item is "span". If I change it manually to "a" it will be fixed.
Comment #5
Anatoliy Vorobyov CreditAttribution: Anatoliy Vorobyov at FFW commentedDrupal Bootstrap theme assume that there will be link: .nav > li > a
Comment #6
super_romeo CreditAttribution: super_romeo as a volunteer commentedI know it, but what should we do?...
Comment #7
imclean CreditAttribution: imclean at Digital Ink commentedFix it in your subtheme wherever your menu styles go. For example,
Comment #8
super_romeo CreditAttribution: super_romeo as a volunteer commentedThank 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.
Comment #9
super_romeo CreditAttribution: super_romeo as a volunteer commentedCache rebuild required.
Comment #10
markhalliwellThis 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 thenavbar-text
class to it accordingly.Comment #11
markhalliwellComment #14
super_romeo CreditAttribution: super_romeo as a volunteer commentedWorks, but there are some bugs:
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.
Want should I do?
Comment #15
super_romeo CreditAttribution: super_romeo as a volunteer commentedComment #16
markhalliwellThat'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).
Comment #18
DanChadwick CreditAttribution: DanChadwick commentedWhoops. Wrong issue.