Closed (fixed)
Project:
Link
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Oct 2007 at 22:20 UTC
Updated:
6 Oct 2011 at 07:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
guillaumeduveauI second this.
Comment #2
quicksketchI wouldn't mind adding this functionality. Any patches posted will gladly be accepted. Since link fields already store an 'attributes' column in the database, the 'onclick' attribute could simply be added to the list.
Comment #3
quicksketchExcept the 4.7 version is no longer supported. I'll post to the 5.x version. If 2 patches are submitted (one for each) I'll still post to 4.7.
Comment #4
restlesscoder commentedHere is a patch for 5.x that adds support for the onClick attribute. You can either specify a static value in the field configuration, or allow the user to type in a value themselves on a per-node basis. Thanks to quicksketch on #drupal for guidance. It is based on 5.x-2.1 though; sorry about that—I didn't realize there was a newer version.
Comment #5
quicksketchAs I said before, I like the idea of adding onclick support but I haven't had the time to properly implement it. Starting with restlesscoders patch, I updated it so that it will effectively kill the 'target' attribute in a mostly friendly way. Basically we'll provide the users with a few handy starter "onclick" attributes, such as "open in new window" and "open in root window" (replacements for target). Then provide an upgrade script that converts previous target attributes to onclicks.
I'm still really short on time these days, and I didn't extensively test this code. Please review and then we can work on porting to 6.x.
I also changed the storage and printing from "onClick" to "onclick", since Drupal uses all lowercase HTML attributes.
Comment #6
quicksketchI'm in no hurry to add this functionality. If it's possible to get some community testing I'd appreciate help reviewing and testing.
Comment #7
restlesscoder commentedWhere can I download the latest version of the link module to use with this patch? I only see 5.x-2.1 available on the site. Thanks.
Comment #8
quicksketchThis patch hasn't yet been committed. You have to apply it to test it out. When the issue has been marked "fixed" the changes have been committed.
Comment #9
restlesscoder commentedI understand that I have apply your patch to the link module. What I'm asking, though, is what version of the link module do I need to use when applying the patch? I tried downloading 5.x-2.1 (the same version I based my patch on, and the latest/only 5.x version available for download from http://drupal.org/project/link), but the line numbers do not line up. I am assuming you based this patch on a different version. So I repeat my question: where can I download it?
Comment #10
quicksketchOh sorry, from the "Releases" section under the Webform project page: http://drupal.org/node/74971/release
Scroll down until you find the 5.x development version. Also, you can checkout the latest version of link module using CVS (http://drupal.org/node/321). Get the DRUPAL-5 or DRUPAL-6--1 branches for the latest code. You can also browse the CVS repository.
Comment #11
restlesscoder commentedThanks for the information, and your work on the patch. I tested it with the DRUPAL-5 branch and it works fine, though so far I am only using the "Allow the user to specify a custom onClick value" option. I'll post another comment if I find any problems, but so far this patch seems effectively address the issue.
Comment #12
quicksketchThis patch isn't going to make it into the 2.2 version because I realized that we'll also need to update the Views integration (which depends on the target attribute currently).
Comment #13
dqdIssue date expired ...
For any feature request please take a look on the link module versions for Drupal 6 and Drupal 7 with much more features and better server and web standart support since Drupal 5 is not supported no more officially.
The stop for Drupal 5 support: Since we have to catch up to get ready for the final Drupal 7 release and have to deal with many feature requests for the Drupal 6 and Drupal 7 version of the link field module, we sadly have to annouce the stop of Drupal 5 support. The files will stay for any individual use or customization, but any support in the issue queue and in the forums has expired from now on.
Sorry and thanks for understanding.