Arbitrary link for images

criznach - May 31, 2007 - 16:59
Project:ImageField
Version:6.x-3.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:patch (code needs work)
Description

Here's a patch for the head version as of 5/31/07 that adds optional link support to imagefields. Link capability can be turned on or off like custom title and custom alt. Also allows optional link target like _blank or _self.

Tested with vanilla imagefields, but I'm not sure how this integrates with imagecache. The sponsoring site doesn't use it, so I haven't had the opportunity to test that combo.

Requires a schema update with update.php to add the url and target fields.

Hopefully someone finds this useful.

AttachmentSize
imagefield_4.patch23.84 KB

#1

dopry - June 16, 2007 - 05:15
Status:patch (code needs review)» patch (code needs work)

This looks like a really cool addition, but I would appreciate it if you could reroll the patch again against the DRUPAL-5--2 branch. There are a lot of changes in that patch.. It almost seems diffed against an earlier 5.x branch which is probably my fault for not keeping head up to date. After the 5.x-2.x branch is released I'll sync head up and continue future development there.

#2

criznach - June 24, 2007 - 01:30

Let me see what I can do... It's working for us now, so the pressure is off. I'm also looking at adding a weight field to the attached images. Any thoughts positive or negative on that?

#3

jnorton - December 1, 2007 - 14:18

Hello,

Is there any update on this patch being available for the 5.2 version of image field?

Thanks,

Justin

#4

philsward - February 7, 2008 - 22:49

I am looking right now for a way to do exactly that! I would love the ability to weight attachments of the images :)

I am playing with the Imagefield Gallery at the moment and while the base functionality is there to setup a nice and easy little gallery, it still lacks the ability to move images.

The only way I know of to do this is delete the images and start over. That's fine if I am the one doing it, but clients will complain which is the ultimate purpose of the gallery...

I don't know what your thoughts or knowledge are on ajax, but It would be "nice" if the weighting were ajax drag & drop based. I.E. Drag the image to the spot where it needs to be displayed, when attaching the images.

If I knew php and ajax, I would help... otherwise the suggestion, though a bit late on the response, would sure be appreciated!

#5

philsward - February 7, 2008 - 22:50

I am looking right now for a way to do exactly that! I would love the ability to weight attachments of the images :)

I am playing with the Imagefield Gallery at the moment and while the base functionality is there to setup a nice and easy little gallery, it still lacks the ability to move images.

The only way I know of to do this is delete the images and start over. That's fine if I am the one doing it, but clients will complain which is the ultimate purpose of the gallery...

I don't know what your thoughts or knowledge are on ajax, but It would be "nice" if the weighting were ajax drag & drop based. I.E. Drag the image to the spot where it needs to be displayed, when attaching the images.

If I knew php and ajax, I would help... otherwise the suggestion, though a bit late on the response, would sure be appreciated!

#7

philsward - February 13, 2008 - 04:05

I think my browser hung when I posted the previous comment, so it posted it twice... This is just an edit to remove the 'second' posting since I can't physically delete it.

#8

jpetso - February 26, 2008 - 19:05
Title:Optional link for imagefields» Arbitrary link for images

Marking #171280: Arbitrary link from image as duplicate of this issue, and stealing its name - I think it can more easily be distinguished in between all those other "link" feature requests.

#9

Fayna - April 16, 2008 - 00:18

Has this patch been committed to ImageField now or does it still need work? Among the many 'links' issues I'm glad I found this one! :P

#10

HeO - July 6, 2008 - 21:19
Category:task» feature request

Changed to feature request.

I'm looking for exactly this functionality and might be willing to adjust/rework the patch to work with the current version.

Since this topic/request/patch is rather old, it would be nice to have some confirmation that this is still a wanted contribution for the ImageField module and not addressed already somewhere else, though.

#11

vojnar - September 16, 2008 - 18:53
Category:feature request» bug report
Priority:normal» critical

Hello,

This is what I get running the patch:

/modules/imagefield# patch < imagefield_4.patch
patching file imagefield.install
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 49.
Hunk #3 succeeded at 108 (offset 13 lines).
2 out of 3 hunks FAILED -- saving rejects to file imagefield.install.rej
patching file imagefield.module
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 75.
Hunk #3 FAILED at 94.
Hunk #4 FAILED at 147.
Hunk #5 FAILED at 162.
Hunk #6 FAILED at 178.
Hunk #7 FAILED at 197.
Hunk #8 FAILED at 216.
Hunk #9 FAILED at 230.
Hunk #10 FAILED at 307.
Hunk #11 FAILED at 332.
Hunk #12 FAILED at 488.
Hunk #13 FAILED at 525.
Hunk #14 FAILED at 563.
Hunk #15 FAILED at 571.
Hunk #16 FAILED at 612.
Hunk #17 FAILED at 623.
Hunk #18 FAILED at 655.
Hunk #19 succeeded at 421 with fuzz 2 (offset -318 lines).
18 out of 19 hunks FAILED -- saving rejects to file imagefield.module.rej

Any idea what should be done? Am I doing something wrong?

Best regards,
Gabor

#12

jpetso - September 16, 2008 - 19:34
Category:bug report» feature request
Priority:critical» normal

@vojnar:
Judging by the output, I can only assume that you patched against a different version than the patch was taken from. That's not a good reason to change the perfectly sensible issue status, though.

@HeO:
It's not addressed in imagefield at least, but I don't know how open the maintainers are for inclusion of this patch. (Might be worth a try, but I can't really tell.)

#13

attiks - September 16, 2008 - 19:48

Hi,

Looked at your patch and kind of like the idea, but please don't use target, it isn't valid xhtml :/ You'll need to use jQuery magic to deal with it :p

Edit: What i mean is don't output the target attribute, but use something like class="target_blank" instead, using jQuery we can do this

  $("a.target_blank").click(function(){
      window.open(this.href,'external');
      return false;
  });

#14

vojnar - September 18, 2008 - 12:06
Category:feature request» bug report

This is the response from the server on the correct imagfield module (6.x-3.x-dev) on a brand new install of D6

patch
patching file imagefield.install
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 49.
Hunk #3 succeeded at 108 (offset 13 lines).
2 out of 3 hunks FAILED -- saving rejects to file imagefield.install.rej
patching file imagefield.module
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 75.
Hunk #3 FAILED at 94.
Hunk #4 FAILED at 147.
Hunk #5 FAILED at 162.
Hunk #6 FAILED at 178.
Hunk #7 FAILED at 197.
Hunk #8 FAILED at 216.
Hunk #9 FAILED at 230.
Hunk #10 FAILED at 307.
Hunk #11 FAILED at 332.
Hunk #12 FAILED at 488.
Hunk #13 FAILED at 525.
Hunk #14 FAILED at 563.
Hunk #15 FAILED at 571.
Hunk #16 FAILED at 612.
Hunk #17 FAILED at 623.
Hunk #18 FAILED at 655.
Hunk #19 succeeded at 421 with fuzz 2 (offset -318 lines).
18 out of 19 hunks FAILED -- saving rejects to file imagefield.module.rej

#15

jpetso - September 18, 2008 - 12:28
Category:bug report» feature request

vojnar: The patch might not apply for you, but this issue is still a feature request for imagefield. Please leave it at that until this functionality is added to the upstream version.

 
 

Drupal is a registered trademark of Dries Buytaert.