Lightbox Images in a bespoke tab.

jQuery based tabbed Product and Fragment Descriptions.
Post Reply
norman
Site Admin
Posts: 1248
Joined: Sat Feb 07, 2004 9:55 pm

Lightbox Images in a bespoke tab.

Post by norman »

Scenario: You want to have Drillpine's Lightbox images show in an IMAGES tab. The tab will only show if some Lightbox images are defined.

Edit layout TabbedProductDescription and look for the line:

Code: Select all

TBPRDSC;
Immediately after it, on a new line, add:

Code: Select all

$lboxicons= <<<TBLBOXICONS
<actinic:variable name="Lightbox" value="Lightbox Image List" />
TBLBOXICONS;
if ( strlen(trim($lboxicons)) )
	{
	if ( preg_match('/(.*?)&#123;&#125;(.*)/s', $desc, $bits) )	// optional {} signifies end of tabbed text
		{
		$desc = $bits[1] . '&#123;IMAGES&#125;' . $lboxicons. '&#123;&#125;' . $bits[2];
		}
	else
		{
		$desc = $desc . '&#123;IMAGES&#125;' . $lboxicons;
		}
	}
Note: Do not indent this code (other than above). The line TBLBOXICONS; must be against the left margin.

The IMAGES tab will only show (as last or only tab) if a some Lightbox images are defined.

You will also need to turn off the usual display of the Lightbox images.
If using Lightbox V4, there is a setting, LightboxProductIconsPosition that you can set to None.
If using Lightbox V3 or earlier, you will have to switch to a product layout that doesn't contain Lightbox Image List (or edit that layout out of your existing product layout).

Tested on SD 2013 with Lightbox V4.0.8 and jQuery Tabber V4.09.
Norman
Post Reply