Problem/Motivation
<nolink> menu items that don't have a URL are rendered as <a href="">link title</a>
Steps to reproduce
Add a link to the main menu, or any menu that uses the navbar nav pattern, with a URL of <nolink>
Proposed resolution
Update the navbar_nav pattern to have an if statement on {{ item.url }}
Remaining tasks
- [x] Fix it
User interface changes
N/A
API changes
N/A
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | Capture d’écran du 2024-02-19 15-49-45.png | 7.71 KB | grimreaper |
Issue fork ui_suite_bootstrap-3422210
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
thejimbirch commentedMerge request created that updates the navbar_nav pattern.
To validate:
<nolink><span>and no longer an<a>Comment #4
thejimbirch commentedComment #5
grimreaperComment #6
grimreaper@thejimbirch, thanks for the bug report and the MR.
@pdureau, I have assigned it to you to get your feedback after my code review. Then I will implement the solution.
Comment #7
grimreaperDiscussed with @pdureau.
No button case to handle. Printing link_attributes. I will test for navbar-text automatic or not. In favor of not placed automatically if no visual difference.
Comment #9
grimreaperComment #10
grimreaperlink_attributes rendered.
No need to add the navbar-text class automatically as it only change the text color. But as you can on the screenshot, it is not aligned with normal links.
So I would say if someone wants to have a nolink or a button, he/she is able to add additional classes using menu_link_attributes or something else.
@thejimbirch, I let you test the MR before merging. I will merge on thursday, in 2 days if no feedback is provided.
Comment #11
thejimbirch commentedCode looks good. Nice catch with the attributes.
Marking RTBC
Thanks!
Comment #13
grimreaper