Starting Slimbox with a "Click for Slideshow" link.

Adds a Lightbox slideshow to your products.
Post Reply
norman
Site Admin
Posts: 1242
Joined: Sat Feb 07, 2004 9:55 pm

Starting Slimbox with a "Click for Slideshow" link.

Post by norman » Fri May 08, 2009 11:35 am

The following is for the Slimbox variation of Lightbox (the one that's usually shipped).

Put the following into your Overall Layout, just above the </head> tag.

Code: Select all

<script type="text/javascript">
<!-- Start Lightbox-Slimbox manually
function startlbox(pid){
	lblist = new Array();
	ancs = document.getElementsByTagName('a');
	for(i=0; i<ancs.length; i++)
		{
		if ( ancs[i].rel == 'lightbox[' + pid + ']' ) lblist.push([ancs[i].href, ancs[i].title]);
		}
	if ( lblist.length ) Slimbox.open(lblist, 0);
}
// -->
</script>
In your Product Layout(s), where you want the link put:

Code: Select all

	<actinic:block if="%3cactinic%3avariable%20name%3d%22LightboxImage1%22%20%2f%3e%20%21%3d%20%22%22%20%0dOR%20%3cactinic%3avariable%20name%3d%22LightboxImage2%22%20%2f%3e%20%21%3d%20%22%22%20%0dOR%20%3cactinic%3avariable%20name%3d%22LightboxImage3%22%20%2f%3e%20%21%3d%20%22%22%20%0dOR%20%3cactinic%3avariable%20name%3d%22LightboxImage4%22%20%2f%3e%20%21%3d%20%22%22%20%0dOR%20%3cactinic%3avariable%20name%3d%22LightboxImage5%22%20%2f%3e%20%21%3d%20%22%22%20%0dOR%20%3cactinic%3avariable%20name%3d%22LightboxImage6%22%20%2f%3e%20%21%3d%20%22%22%20%0dOR%20%3cactinic%3avariable%20name%3d%22LightboxImage7%22%20%2f%3e%20%21%3d%20%22%22%20%0dOR%20%3cactinic%3avariable%20name%3d%22LightboxImage8%22%20%2f%3e%20%21%3d%20%22%22%20%0dOR%20%3cactinic%3avariable%20name%3d%22LightboxImage9%22%20%2f%3e%20%21%3d%20%22%22%20%0dOR%20%3cactinic%3avariable%20name%3d%22LightboxImage10%22%20%2f%3e%20%21%3d%20%22%22" >
		<a href="javascript:startlbox('<actinic:variable name="EncodedProductAnchor" encoding="perl" selectable="false" />')">Click for larger image</a>			
	</actinic:block>
The humungous Condition prevents this link from showing unless at least one Lightbox image is defined.
Norman

Post Reply