Changing the title / caption in an Image + Imagecache setup
wuwei23 - June 16, 2009 - 05:12
| Project: | Lightbox2 |
| Version: | 6.x-1.9 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hey everyone,
I'm running Lightbox2 6.x-1.9 alongside Image 6.x-1.x-dev & ImageCache 6.x-2.0-beta9, under Drupal 6.12.
By default, this setup uses the image node title as the title, alt & description fields for the img tag, and displays it as the caption in the lightbox view. I'd like to change this to display the node body instead, but I'm not entirely sure where I should do this. I've tried changing some of the functions in lightbox2.formatter.inc but nothing I did seemed to make any difference whatsoever.
Any help would be greatly appreciated.

#1
Similar setup, I notice the caption comes from the ALT tag in my imagecache images. Is there no setting to choose title tag instead?
#2
Hey mxistence,
I managed to get the results I needed by copying the function theme_imagefield_image_imagecache_lightbox2 from lightbox2.formatter.inc into template.php, renaming it to phptemplate_imagefield_image_imagecache_lightbox2.
There's a section with the comment "Enforce image alt" which I commented out entirely and replaced with some code to construct the caption I needed from the title & taxonomy terms.
I'm not sure if this is the best way to do it but it works for me :)