Download & Extend

make preview image be a link to original image

Project:Upload previews
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

Comments

#1

+1 for the change. Subscribing.

#2

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

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

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

Thanks
Robert

#5

Status:reviewed & tested by the community» fixed

Committed to CVS will be in the next devel release.

#6

Status:fixed» closed (fixed)

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

nobody click here