Page 1 of 1

Tabber - Auto tab for each Component.

Posted: Mon Mar 15, 2010 11:23 pm
by norman
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.

Re: Tabber - Auto tab for each Component.

Posted: Sat Mar 20, 2010 4:57 pm
by dunchutch
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!

Re: Tabber - Auto tab for each Component.

Posted: Sat Mar 20, 2010 5:55 pm
by norman
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.

Re: Tabber - Auto tab for each Component.

Posted: Sun Mar 21, 2010 4:39 pm
by dunchutch
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

Re: Tabber - Auto tab for each Component.

Posted: Fri Jun 25, 2010 8:44 am
by patchworkrabbit
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).

Re: Tabber - Auto tab for each Component.

Posted: Fri Jun 25, 2010 9:18 am
by norman
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!