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.
Hey there,
Overriding the theme_menu_link
causes problems, the attached (sorry, way too busy for a patch) is a modified version which uses theme_link
instead.
(I also checked the dev version and it was no different, the theme_menu_link
function has to be removed altogether.)
Comments
Comment #1
mehrpadin CreditAttribution: mehrpadin commentedSorry, something went wrong, here's it again.
Comment #2
pfx CreditAttribution: pfx commentedI try this new special_menu_items.module and now nolink work fine with the superfish menu.
Thanks
Comment #3
pfx CreditAttribution: pfx commentedI just noticed that the tag
<a
is effectively replaced by the tag<span
but there is no class nolink in it.Comment #4
a.ross CreditAttribution: a.ross commentedThis is a step in the right direction to fix the issues with the module generating a faulty link. It should be optional how menu items are formatted (span, href="#", ...) but this is the way to go. I've merged in this file to the latest revision of the module and have attached the resulting patch. I think development continued in the master branch, so the patch should be applied there, but I'm not entirely sure.
Everything appears to be working fine with the patch, including the menu item listing in
admin/structure/menu/manage/<menu>
. I'll mark this RTBC, any issues that are caused by the mismanagement of code in git shouldn't need to affect this issue.Comment #5
hermes_costell CreditAttribution: hermes_costell commentedIf this helps with the module steamrolling special classes I'm trying to send to the individual menu items that would be stellar!
Comment #6
a.ross CreditAttribution: a.ross commentedDo you mean something like this?
Comment #7
kingfisher64 CreditAttribution: kingfisher64 commentedapplying the patch on #4 to the special menu items mod works great. If you want the styling to match the default superfish theme styling (in terms of margin & padding) add the following to the relevant stylesheet.
Comment #8
BoobaaThe patch in #4 works great; without that this module is pretty much useless: redirecting the user to a 404 page from a "nolink" is a PITA.
Comment #9
DuaelFrHi mehrpadin and a.ross and thank you very much for your work.
I took a look to your code and patch and I cannot leave this issue as RTBC because :
Regards
Comment #10
a.ross CreditAttribution: a.ross commentedYeah, patch was made on a windows system, which causes problems with line endings and possibly other stuff. I didn't actually mark my patch as RTBC per se, I meant to mark Mehrpadin's code RTBC. I've reviewed and tested it and we're using it in production right now.
I'll see if I can have a second look at it at home (where I'm using a proper OS).
Comment #11
gagarine CreditAttribution: gagarine commentedI will love if someone can propose a patch against the branch 7.x-1.0. #1221294: option to use <a href="#"> for "nolink" items to not break other modules is going to have an incidence on this (patch 23 was commited)?
Comment #12
gagarine CreditAttribution: gagarine commentedComment #13
gagarine CreditAttribution: gagarine commentedProper patch against 7.x.1.0. But need one against dev.
Comment #14
tars16 CreditAttribution: tars16 commented#13 failed for me with 7.x-1.0:
Comment #15
a.ross CreditAttribution: a.ross commentedI can confirm.
Comment #16
pog21 CreditAttribution: pog21 commentedSame problem here as #14. Any progress on this?
Comment #17
a.ross CreditAttribution: a.ross commentedPatch rerolled against -dev. Please review
Comment #18
a.ross CreditAttribution: a.ross commentedNew patch, this time using the 'proper' name for the default menu_link function. This also removes the theme_menu override completely.
Comment #19
gagarine CreditAttribution: gagarine commentedCommited. Thanks a lot
Comment #20
pog21 CreditAttribution: pog21 commentedThanks for the patch. It seems to be working. One small thing, isn't there supposed to be a class='nolink' added to the span?
Comment #21
gagarine CreditAttribution: gagarine commented@pog21 please feel free to open a new bug