Tabber - Auto tab for each Component.

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

Tabber - Auto tab for each Component.

Post by norman » Mon Mar 15, 2010 11:23 pm

It is possible to automatically put each Component onto a separate tab. Useful if you have a set of optional componennts.

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

2) Rename that copy to be TabbedProductDescription ComponentsOnTabs.

3) Edit TabbedProductDescription ComponentsOnTabs and look for the line

Code: Select all

TBPRDSC;
4) Immediately above that add:

Code: Select all

<actinic:block type="ComponentList">
	&#123;<actinic:variable name="ComponentName" selectable="false" />&#125;
	<actinic:variable name="ComponentLayout" />
</actinic:block>
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 ComponentsOnTabs.

8) Edit Standard Layout Using CSS - Tabbed Descriptions ComponentsOnTabs look for the line:

Code: Select all

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

9) Also look for the line

Code: Select all

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

Code: Select all

             <actinic:variable name="TabbedDescription" value="TabbedProductDescription ComponentsOnTabs" />
11) OK out.

Now if you use layout Standard Layout Using CSS - Tabbed Descriptions ComponentsOnTabs for a product and use some you'll find a tab for each Component.
Norman

dunchutch
Posts: 2
Joined: Sat Mar 20, 2010 4:54 pm

Re: Tabber - Auto tab for each Component.

Post by dunchutch » Sat Mar 20, 2010 4:57 pm

Hi Norman,

Having had a play with tabber firstly I would like to say it is very good and simple to use (useful for us simple people!)

I have created an extra variable for each of my components so I can categorise them. What I want to do is have ALL components from a particular category on one tab - there will be 5 tabs with upto 5-15 components on each tab.

Is this possible?

Duncan

PS - thanks for all your help so far!

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

Re: Tabber - Auto tab for each Component.

Post by norman » Sat Mar 20, 2010 5:55 pm

Possible but not simple. You'd need good PHP skills (you get full source code with Tabber and can use the posted tweaks for guidance on how to enhance it) or commission someone to do it for you.
Norman

dunchutch
Posts: 2
Joined: Sat Mar 20, 2010 4:54 pm

Re: Tabber - Auto tab for each Component.

Post by dunchutch » Sun Mar 21, 2010 4:39 pm

Hi Norman,

Just wanted to say I think I have found a way round the problem which is relatively straight forward:

1) Create new component lists which only contain for example components 1-5
2) put each component list onto a different tab

In my case it helps that each product has exactly the same components otherwise although it is possible it would be very time consuming to have different component lists for each product.

Seems to be working but when I have completed I will confirm!

Kind regards,
Duncan

patchworkrabbit
Posts: 2
Joined: Thu Jun 24, 2010 2:42 pm

Re: Tabber - Auto tab for each Component.

Post by patchworkrabbit » Fri Jun 25, 2010 8:44 am

Hi Norman,

I'm loving Tabber, it looks so professional and had great fun recolouring the tabs :)


I've just started playing with components, and have put my components in an auto-tab as described which works really well. However, when I add more tabs in the description, the manual tabs are first in the tab bar. I'd like the components tab to be the first one. Is that a simple change? (I have zero PHP).

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

Re: Tabber - Auto tab for each Component.

Post by norman » Fri Jun 25, 2010 9:18 am

Components on first tab:

Do post #1 but replace step 4 with:

4) Immediately after that add:

Code: Select all

$comps = <<<TBPRDSC
<actinic:block type="ComponentList">
   &#123;<actinic:variable name="ComponentName" selectable="false" />&#125;
   <actinic:variable name="ComponentLayout" />
</actinic:block>
TBPRDSC;
if ( preg_match('/(.*?)(&#123;.+?&#125;.*)/s', $desc, $bits) )	// is there at least one tab?
	{
	$desc = $bits[1] . $comps . $bits[2];	
	}
else
	{
	$desc .= $comps;
	}
NB only lightly tested!
Norman

Post Reply