I have used this module for several months without a hitch. Many useful instructions for CCK + Imagefield + Imagecache + Lightbox2.
Now, trying to push my site a bit further I'm delving into themeing nodes and content types and am not sure how to get images with the correct call to Lightbox2.
What I'm doing:
in a custom node-photos.tpl.php I do:
<?php if ($field_photoimage[0]['filepath']): ?>
<?php print theme('imagecache', 'small', $field_photoimage[0]['filepath'],$title,'',array('class' => 'small')); ?>
<?php endif; ?>
This gets a the field with the CCK fieldname 'photoimage' and outputs the 'small' size image I have specified in Imagecache. Works great in terms of Imagecache functionality. But it seems to break the Lightbox2 augmentation of the image, I no longer have any Lightbox2 functionality when themeing nodes manually as above.
My question is: what can I add to the above code to output the picture with Lightbox2 functionality, just as if I'd not themed the node?
Many thanks.
Comments
Comment #1
stella commentedI would use the
theme('imagefield_image_imagecache_lightbox2')function.It's best to look through this function and
lightbox2_imagefield_image_imagecacheto see what the passed in arguments require.Comment #2
zhte commentedThanks for such a quick reply,
I'm having a bit of trouble figuring what to put in $item. Here's what I've got and I'm doing.
Calls all things in the node object, which gives:
So I used the function you kindly suggested and changed $field to $field_photoimage (I alse tried variants like $field_photoimage[0], $field_photoimage[0]['filepath']), I changed $item to 0, filepath, 'filepath' and a number of other variants and $rel to 'lightbox'.
None of these approaches worked. Given the above Node Object I'd be interested in how I could get a lightbox on the photoimage field - I'm clearly not doing something right.
A very gracious thanks.
Comment #3
stella commentedIt's designed to be used from views or somewhere you have access to the individual field items.
Try:
Comment #4
zhte commentedThat works beautifully, thank you so much.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
dagomar commentedBe that as it may, but where do I find the $node object from a view?
Comment #7
stella commentedYou'd have to ask someone more familiar with theming views I'm afraid.