Additional tabs with fixed content.

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

Additional tabs with fixed content.

Post by norman »

If you want all your descriptions to have additional tabs containing fixed content, e.g. delivery info, returns info, then the following will help.

Edit layout TabbedProductDescription (or TabbedProductTabs) and look for the line

Code: Select all

TBPRDSC;
Immediately below that put the code that you want to display in tabs as per the example below (HTML should be OK):

Code: Select all

$permtabs = <<<TBPRDSC
{DELIVERY}
Delivery info here
.
.
{RETURNS}
Returns info here
.
.
TBPRDSC;
Look for the line:

Code: Select all

	while ( preg_match('/&#123;(.*?)&#125;(.*)/s', $tabcode, $bits) )

Immediately above it add:

Code: Select all

	$permtabs = str_replace('{', '&#123;', $permtabs);
	$permtabs = str_replace('}', '&#125;', $permtabs);
	$tabcode .= $permtabs;	
You can add more tabs but make sure you leave the first and last lines of that block alone.

Optionally, you could also put the additional content into a Variable or Layout and use that instead of the embedded text. E.g.

Code: Select all

$permtabs = <<<TBPRDSC
<actinic:variable name="MyAdditionalTabs" />
TBPRDSC;
Norman
valves
Posts: 8
Joined: Mon Oct 04, 2010 1:30 pm

Re: Additional tabs with fixed content.

Post by valves »

I have added this to my layouts, but nothing shows up as fixed content, although the tabs I add normally work ok?
Do I need to add soemthing else?
I use fragments and select the tabbed layout.
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: Additional tabs with fixed content.

Post by norman »

That ReadMe is for Product Descriptions. If you are using Fragments based on the simpler layouts you will have to make these changes to the layout TabbedFragmentText.
Norman
valves
Posts: 8
Joined: Mon Oct 04, 2010 1:30 pm

Re: Additional tabs with fixed content.

Post by valves »

Excellent! thankyou.
Post Reply