Is it possible to have Lightbox work with Image Gallery and Image Attach? It seems like I just need to edit the path and attributes of the following function calls so that the new path will be the path of the image rather than its node and the attributes will contain rel="lightbox".
Image Gallery:
$content .= l(image_display($image, IMAGE_THUMBNAIL), 'node/'. $image->nid, array(), NULL, NULL, FALSE, TRUE);
Image Attach:
$output .= l(image_display($image, $img_size), "node/$node->iid", array(), NULL, NULL, FALSE, TRUE);
Comments
Comment #1
sunYes, that's possible. But also via JavaScript, so may test attached patch.
Comment #2
bkark commentedThanks. The JavaScript does work but didn't meet all my needs so I went ahead and hacked the image modules.
For image attach, I was using a custom image size and wanted the lightbox image to be the "Preview" size. I updated the Javascript to look for that image size rather than "Thumbnail" and replaced the image src with ".preview".
However I had problems sometimes with the lightbox image displaying since some of my images didn't have "preview" in the file name. I have "Preview" set to be 640x640 so I think what's happening is if I upload an image that's smaller than those dimensions it won't generate a "Preview" image. And so for these images the src should be the original file's name. I tried to use AJAX to figure out which image, the preview or original, actually existed, and to update the src accordingly but couldn't figure out how to do it.
Another thing that I wanted to do was have all the images in the same gallery as the attached image be displayed in the lightbox.
The only way I could figure out how to do both of these things was to edit the modules directly. It isn't pretty but it seems to do the trick.
Comment #3
sunThanks, committed!
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.