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.
With some add-on modules, one is able to create a "placeholder" menu item whose path ends up being "javascript:void(0)", which breaks the current logic for creating menu-items classes.
I propose to use the Drupal 7's in-built drupal_clean_css_identifier
drupal_html_class
which will take care of stripping out everything except plain text.
Patch to follow in first comment.
Comment | File | Size | Author |
---|---|---|---|
#2 | nice_menus-clean-css-class-1710492-2.patch | 1.27 KB | jwilson3 |
#1 | nice_menus-clean-css-class-1710492.patch | 1.29 KB | jwilson3 |
Comments
Comment #1
jwilson3Comment #2
jwilson3Just realized there's an even better solution, that converts to lowercase.
Comment #3
xiukun.zhou CreditAttribution: xiukun.zhou commentedThanks a lot to jwilson3 .This is a very good patch
It's more time this got committed and I went ahead and had this rolled at: 7.x-2.x: 19949d3.
Marking this as fixed.
Please let me know if you would have any other questions, comments, issues or concerns on any of these changes, I would be glad to provide more information.
Thanks again to everyne for the help and great work on this issue.
Cheers!
Comment #4
xiukun.zhou CreditAttribution: xiukun.zhou commentedComment #5
jwilson3thanks for including this :)
Comment #6.0
(not verified) CreditAttribution: commentedUse drupal_html_class() for menu-path class instead of drupal_clean_css_identifier()