Tabber V3 - Displaying Actinic content in the first tab.

Tabbed Product and Fragment Descriptions.
Post Reply
norman
Site Admin
Posts: 1237
Joined: Sat Feb 07, 2004 9:55 pm

Tabber V3 - Displaying Actinic content in the first tab.

Post by norman » Fri Feb 24, 2012 1:23 am

This tweak is for Tabber V3.

It is possible to tweak Tabber to automatically create a first tab containing other bits of the Product Layout. The tab will only be created if there's some content in it.

In the example below we'll move the Components and Attributes to the first tab.

1) Go to Design / Library / Layouts / TabbedDescription; right-click TabbedProductDescription and select Copy.

2) Rename that copy to be TabbedProductDescription Customised.

3) Edit TabbedProductDescription Customised and look for the line

Code: Select all

TBPRDSC;
4) Below that line append:

Code: Select all

// START Customisation to include Actinic content as first tab
$firsttab = <<<ENDOFCODE
<actinic:variable name="AttributeList" />
<actinic:variable name="ComponentList" />	
ENDOFCODE;
if ((strlen($firsttab)) > 10 ) $firsttab = '&#123;CHOICES&#125;' . $firsttab;	// only add tab if there's some content
	{
	if ( preg_match('/(^.*?)(&#123;.+?&#125;.*$)/s', $desc, $bits) )	// is there at least one tab?
		{
		$desc = $bits[1] . $firsttab . $bits[2];
		}
	else
		{
		$desc = $desc . $firsttab;
		}
	}
// END Customisation to include Actinic content as first tab
5) OK out.

6) Go to Design / Library / Layouts / Products; right-click Standard Layout Using CSS - Tabbed Descriptions and select Copy.

7) Rename that copy to be Standard Layout Using CSS - Tabbed Descriptions Customised.

8) Edit Standard Layout Using CSS - Tabbed Descriptions Customised and look for the line

Code: Select all

         <actinic:variable name="TabbedDescription" value="TabbedProductDescription" />
9) replace that line with

Code: Select all

         <actinic:variable name="TabbedDescription" value="TabbedProductDescription Customised" />
10) Finally, in product layout Standard Layout Using CSS - Tabbed Descriptions Customised look for the lines

Code: Select all

         <actinic:variable name="AttributeList" />
         <actinic:variable name="ComponentList" />
and delete them.

Now if you use layout Standard Layout Using CSS - Tabbed Descriptions Customised for a product you'll find a first tab CHOICES containing the Actinic Components and Attributes.

It is easy to add additional tabs for other elements. Just repeat steps 3 and 4 (amending the word CHOICES and replacing the two Actinic Variables. Don't change anything else.
Also do step 10 to remove these Variables from their usual place in the product layout.
Norman

leej
Posts: 46
Joined: Thu May 17, 2007 10:03 am
Location: Otley, Leeds
Contact:

Re: Tabber V3 - Displaying Actinic content in the first tab.

Post by leej » Mon Oct 01, 2012 4:36 pm

Hi Norman,
could you tell me how to force the Tabber to display without having to add the {Description} text before your description content within the editor. Basically the client woudl like the tabber to be active immediately. Thanks for any help regarding this.

Regards.
Lee.

norman
Site Admin
Posts: 1237
Joined: Sat Feb 07, 2004 9:55 pm

Re: Tabber V3 - Displaying Actinic content in the first tab.

Post by norman » Mon Oct 01, 2012 5:25 pm

To force an initial "Description" tab:

Edit layout TabbedProductDescription.

Look for the line:

Code: Select all

TBPRDSC;
Immediately after it add:

Code: Select all

if ((strlen($desc)) > 10 ) $desc = '&#123;Description&#125;' . $desc;   // only add tab if there's some content
Norman

leej
Posts: 46
Joined: Thu May 17, 2007 10:03 am
Location: Otley, Leeds
Contact:

Re: Tabber V3 - Displaying Actinic content in the first tab.

Post by leej » Mon Oct 01, 2012 5:34 pm

Hi Norman,
Many thanks once again for the solution.
Regards.
Lee.

Post Reply