make preview image be a link to original image

stella - January 16, 2008 - 12:12
Project:Upload previews
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,

I was wondering if you could change the preview image in the file attachments list to be a link to the original image? I maintain the Lightbox V2 module and without the addition of a link/anchor tag, it's not possible to display the image in a lightbox or similar tools (e.g. thickbox), which was requested in #210488. I also think it would be easier than clicking on the filename to download/view the original image.

The code in question is generated by theme_upload_preview_image(), but I can't override a theme function from within a module. The function that calls it is a hook function, but due to the order in which the hooks are implemented, I still can't change the attachment list to have an image link.

The attached patch should make the preview image be a link to the original image. If you have any questions, please let me know.

Cheers,
Stella

AttachmentSize
upload_preview_image_link.patch879 bytes

#1

levavie - January 16, 2008 - 13:15

+1 for the change. Subscribing.

#2

levavie - January 16, 2008 - 16:43
Status:needs review» active

I've tested the patch - image links work great!

The only note is that the class of the generated preview image is 'upload_preview_image'. That's great but the implication is that after this patch is committed, lightbox v2 will also have to be changed to support this new CSS class.

#3

stella - January 17, 2008 - 10:06
Status:active» reviewed & tested by the community

Lightbox will need a small change alright, but having a "upload preview" specific class is a good idea.

Cheers,
Stella

#4

rmiddle - October 9, 2008 - 04:13

Patch looks pretty good need to look into inclusion in the module.

Thanks
Robert

#5

rmiddle - December 6, 2008 - 03:03
Status:reviewed & tested by the community» fixed

Committed to CVS will be in the next devel release.

#6

System Message - December 20, 2008 - 03:12
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.