Closed (won't fix)
Project:
Link
Version:
6.x-2.9
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Apr 2011 at 06:11 UTC
Updated:
19 Dec 2015 at 21:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jasonsavino commentedI am adding a patch based on the quick fix I made.
Comment #2
jasonsavino commentedneeded to add a conditional statement. Use this patch, ignore the first one.
Comment #3
gastewart commentedDid you, by any chance, edit the patch file by hand to add your conditional statement ?
I applied your original patch cleanly, added the changes you made to your v2 patch, and attached this as a v3 patch.
Cheers,
gavin.
Comment #4
baebs commentedawesome, exactly what I needed -- is it correct that only if a new link field is generated within a content type the 'onClick' attribute appears in the Global Settings of the UI -- meaning it doesn't work to add the 'onClick' event to an already existing link field through the UI?
Comment #5
brycesenz commentedsubscribing. Any chance of this being committed soon?
Comment #6
dqdsadly no. we have priority in catching up all 7 issues to get done the D7 final release soon in the first place. Drupal 5 support is dropped off now but files stay online for any use.
Feel free to provide patches for D6 since we surely will rework them all after D7 release to collect the best for D6 committing.
Comment #7
dqdComment #8
dqdComment #9
gastewart commentedNew patch includes previous patches and provides an optional unfiltered output for onclick, allowing embedded javascript to work as expected. Especially useful for Google Analytics, where you want a URL to look something like:
and not like it was:
Warning: some internal variables were renamed, if you have already been using the onclick patch you may find you need to re-enter your onclick string.
Comment #10
ptoly commentedI put these changes into the latest dev - 6.2x 2011-10-09, and attempted to create a patch. I 'think' I got the patch files path's correct but I'm still new to creating patches...
Comment #11
hongpong commentedWould love to have this available. On a related note for D7 someone else did a hook form alter trick for adding this feature. see https://drupal.org/node/2109265 for their code.
Comment #12
dqdUsually Drupal handles onclick events with actions and rules module. Can anyone confirm that this is not working with link module in D6? Or can anyone report in more detail how this feature request here differs from the usual route we go in Drupal to add actions onclick? Thanks for any details on this.
And please beware that Drupal 6 support is not granted for a too long time after Drupal 8 core release. So we should not put too much energy into this. Unless another user can be persuaded to provide a full patch review for this last patch here before we commit it. Thanks for understanding.
Comment #13
drclaw commentedIf anyone is looking for this for D7, I've created a little module that adds onclick as a "sub" field of the link module. https://www.drupal.org/project/link_onclick
Comment #14
jcfiala commentedSince drclaw's module fixes this problem, I've added a link to it on the description page, and am closing this issue for now.