Closed (works as designed)
Project:
Menu Attributes
Version:
7.x-1.0-rc3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2013 at 17:09 UTC
Updated:
8 Jan 2016 at 19:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
albertski commentedHere is a patch that implements this:
Comment #2
Mołot commentedWorks for me and mines.
Comment #3
stephaniefuda commentedThis patch does works for me, I've got an issues with my onclick quotes getting encoded (javascript based click tracking), but this may not be the patch - I'mnot sure yet.
Thanks!
Comment #5
Diane Bryan commentedVery interested to see this fixed! I'll ask our Tom to look into it.
Comment #6
joelpittetConsidering adding this feature if it was disabled by default, and maybe add a tests for the encoding that @Stephanie_42 mentioned in #3
Would turning it off by default, and then just allowing people to enable it through the menu settings work for you?
admin/structure/menu/settings
@Stephanie_42 is it the double quote or single quote encoding that is not working? I would assume that double quotes would be encoded because you'd break the attribute. Also a bit concerned for security here... but discuss that later unless some one can speak to that?
Comment #7
limonazzo commented4 drupal 6 i use Menu attributes and modify:
menu_attributes.admin.inc
and
on menu_attributes.module.
Comment #8
jpoika commentedI have made the changes to the rc3 version of menu_attributes. Can this be part of the standard?
Comment #10
joelpittetI'm not sure we want to do this but you can add this with
hook_menu_attribute_info()in your own custom module quite simply.Comment #11
jpoika commentedCorrected the error, in case you change your mind.
Comment #12
joelpittet@jpoika maybe you could create a new module called "menu_attributes_events" and add all the JS event attribute handlers. onmouseover,onblur, etc?
Comment #13
malcomio commentedYes I think it's better to keep event handling out of this module and create a separate module for people who would want that.
For me, Javascript code belongs in a module or a theme so it can be under version control, and allowing code to be added via the CMS is an extra attack vector.
This module allows adding an id to a link, so it's very straightforward to target any menu link.