I'm trying to create a Lightbox2 from photos that reside in the right hand column of a custom content type. I need the first thumbnail image to show in the gallery and clicking on it triggers Lightbox2 to show the rest of the images.

Here's the code I have thus far:

foreach($node->field_right_col_photos as $photo) {
	if ($photo['imceimage_path']) {
		print $photo['view'];
	}
}

How do I rewrite this to get Lightbox2 to work inside my page-x.tpl.php and node-x.tpl.php files with IMCE Image?

Comments

visualnotion’s picture

I should have asked this instead:

How do you integrate Lightbox2 with this CCK field? Is it even possible?

panis’s picture

Status: Active » Closed (works as designed)

one of 2 options:
- you will need a bit of javascript/jquery magic - add it to your theme page.tpl.php file or other location. add the necessary lightbox class to the cckimage field images. (look at lightbox documentation to see how to get this going) The image fields in 6.x-1.0-dev now have a class of "imceimage-[field name]", replace field name with the name of the field, OR if you want this to kick in for all imceimage fields you can use something like this to select all these images. http://james.padolsey.com/javascript/regex-selector-for-jquery/
- override the theme_imceimage_image() template in your theme to output the imceimage anyway you wish with any attached behaviours such as lightbox.