Jump to content
Sign in to follow this  
mujina

Category tabs with subs V2.0 (last version)

Recommended Posts

I have been using this contribution for a while, but it is only now when we're about to move our site to a new domain that I want to make a few changes. I only use the subtab categories because I have the main categories in the header.

 

Is there a way to list the subcategories in columns instead of listing them continuously in one line (for example, in 3 columns)? This is what my subtab looks like now:

 

subtab1.gif

 

I would like it to resemble what I have done with the subcategories in our Customer Service section.

 

subtab2.gif

 

Thanks for your help in advance.

Share this post


Link to post
Share on other sites

i have found a bug with this.

 

if you select a product from any of the info boxes, the tabs at the top do not reflect where you have gone to?

 

can someone please advise on a cure?

 

many thanks

 

YT


there are 10 types of people who understand binary

 

those that do, and those that don't

Share this post


Link to post
Share on other sites
i have found a bug with this.

 

if you select a product from any of the info boxes, the tabs at the top do not reflect where you have gone to?

 

can someone please advise on a cure?

 

many thanks

 

YT

 

Well it works fine for me

Share this post


Link to post
Share on other sites
i have 3 levels of categories Main,Sub & Sub2, now when a sub is clicked it will show all of the sub2 cats aswell, how can i make it so it does not show any sub2 cats?

 

The solution to this is using the following if statement

if ($fooa[$counter]['level'] == 1) { }

 

Like this

 

Change

	// display category name
$subcategories_string .= $fooa[$counter]['name'];

$subcategories_string .= '</a> ';

if ($fooa[$counter]['next_id']) {
	$subcategories_string .= '| ';
	show_subcategories($fooa[$counter]['next_id']);
}else{
	$subcategories_string .= ' ';
}
}

to

// display category name
if ($fooa[$counter]['level'] == 1) {
$subcategories_string .= $fooa[$counter]['name'];
}



$subcategories_string .= '</a> ';

if ($fooa[$counter]['next_id']) {
	if ($fooa[$counter]['level'] == 1) {
	$subcategories_string .= '| ';
	}
	show_subcategories($fooa[$counter]['next_id']);
}else{
	$subcategories_string .= ' ';
}
}

 

Change the == 1 to what ever you need. == 2 would means only show sub level 2. <=2 would mean show sublevel 1 and 2. Play with it

Share this post


Link to post
Share on other sites

I am using this with STS and have found that when I have more subcategories than will fit in one row across, the whole subcategories area becomes distorted and won't properly display all of the subcategory names. Any idea on what is causing this?

 

Also - for cagegories that do not have a subcategory - is there a way to hide the subcategories row?

 

PS - Once you have clicked into a subcategory, the category tab no longer is a link to that category - how do you make it so they can click that tab and get back to the parent category?

 

The solution to this is using the following if statement

if ($fooa[$counter]['level'] == 1) { }

 

Change the == 1 to what ever you need. == 2 would means only show sub level 2. <=2 would mean show sublevel 1 and 2. Play with it

Edited by TracyS

~Tracy
 

Share this post


Link to post
Share on other sites

Figured out one part - the ability to keep the category tab's linked, so if they are in a subcategory and want to get back to the parent category page they can.

 

In includes/categories_tab.php I changed this:

// if tab selected we dont need a link
  if (!$onpage) {
$categories_string .= '<a class="tabsNavigation" href="';
$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
$categories_string .= '">';
  }

 

to this:

// if tab selected we dont need a link
//	  if (!$onpage) {
$categories_string .= '<a class="tabsNavigation" href="';
$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
$categories_string .= '">';
//	  }

 

Still trying to figure out the hiding when no subcategories are present, and why it gets all weirded out if the subcategories won't fit in just one row across the page.

 

I am using this with STS and have found that when I have more subcategories than will fit in one row across, the whole subcategories area becomes distorted and won't properly display all of the subcategory names. Any idea on what is causing this?

 

Also - for cagegories that do not have a subcategory - is there a way to hide the subcategories row?

 

PS - Once you have clicked into a subcategory, the category tab no longer is a link to that category - how do you make it so they can click that tab and get back to the parent category?


~Tracy
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×