Maybe u added some logo or something to your picture you display with lb2 and want users to be able to save it as such.
So, if u want to use imagecache image in "SAVE ORIGINAL" then add to template.php "theme_imagefield_image_imagecache_lightbox2" function u can find in lighbox2.formatter.inc and change line 187 from
$node_links[] = l($download_link_text, $item['filepath'], array('attributes' => array('target' => '_blank', 'id' => 'download_link_text')));
to
$node_links[] = l($download_link_text, imagecache_create_url($args['lightbox_preset'], $item['filepath']), array('attributes' => array('target' => '_blank', 'id' => 'download_link_text')));;
and u will have it like that. just wanted to share this with community.
Comments
Comment #1
stella commentedMaybe add a section on this to http://drupal.org/node/274487 along with a clearer explanation of how they can do this from within their own theme without modifying the lightbox2 code.
Cheers,
Stella
Comment #2
el_rob commentedI just stumbled over this post, as I was looking for this solution. Maybe I can clarify a bit...
I have a gallery page where the thumbnails are created by an imagecache preset named "small". Clicking on the thumbnail, lightbox opens the imagecache preset "big", which is basically the original picture, but with a copyright watermark added to it by imagecache_actions module. Now I do want visitors to be able to save the picture in the original size, but only the watermarked version. However by clicking on the link "Save original" in the lightbox, the original image is displayed.
By adding the following code to your template.php, the "Save original" link points to the imagecache preset opened by the lightbox, instead of the original picture:
Note, in the above code, we changed the following line:
to point to the imagecache preset
However, is there any chance to extend Lightbox2 modules core, to have the option of the "Save original" link pointing either to the original or an imagecache preset? That would be greatly appreciated!
Thanks,
Rob
Comment #3
stella commentedComment #4
dman commentedCode looks logical.
I also had need to remove access to the unwatermarked files. (Drupal experts could probably still get them if they tried ;=)
Yep, If there is to be a direct link to the file - it should be to the chosen file, not the system default.
terribly worded OP however!
Comment #5
mxtHow I can link to ANOTHER arbitrary imagecache preset, and not the already existing associated one?
Thank you for your help.
PS: + 1 for "However, is there any chance to extend Lightbox2 modules core, to have the option of the "Save original" link pointing either to the original or an imagecache preset? That would be greatly appreciated!"
Comment #6
mxtOk, I've got it: simply you have to indicate the imagecache preset you want to use, for example:
Hope this help.