View Single Post
  #1  
Old 09-25-2005, 12:12 AM
 
Mr Bob Mr Bob is offline
 

Senior Member
  
Join Date: Jul 2005
Posts: 199
 

Default Only display 2nd level down sub categories

My category setup:
Dogs/Dog Name 1/Dog
Dogs/Dog Name 2/Dog
Dogs/Dog Name 3/Dog
Birds/Bird Name 1/Bird
Birds/Bird Name 2/Bird
Birds/Bird Name 3/Bird
Cats/Cat Name 1/Cat
Cats/Cat Name 2/Cat
Cats/Cat Name 3/Cat

When someone clicks on the 1st category (example Cats), it will display Cat Name 1, 2, and 3. After they click on Cat 1, 2, or 3, I want the same list to still display.

And to say it another way, that might be easier to understand... I always want the 2nd level category to display. If you click Birds as the main category, I want Bird Name 1, 2, and 3 to display. When you click on Bird Name 1, 2, or 3, I still want the Bird Name 1, 2, or 3 to display.

The following code only displays the subcategory for the page you are on, thus if you are on Cats/Cat Name 3/Cat it will NOT display the products under Cats.

Anyone help me out with this?

Code:
{* $Id: left_subcategories.tpl,v 1.00.0.0 2005/11/24 04:10:00 mclap Exp $ *} {if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":" "}{/if} {assign var="tmp" value="0"} {section name=cat_num loop=$subcategories} {if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if} {/section} {if $subcategories} {if $tmp}{/if} <div id="siteBodyLeftSubCats"> <div id="siteBodyLeftSubCatsTitle"> <div id="siteBodyLeftSubCatsTitleLeft"></div> {$current_category.category} <div id="siteBodyLeftSubCatsTitleRight"></div> </div> <ul class="subNav"> {foreach from=$subcategories item=subcat}<li class="subNavLink">{ $subcat.category|escape }{/foreach} [/list] <div id="siteBodyLeftSubCatsLL"></div> <div id="siteBodyLeftSubCatsLR"></div> </div> {/if}
__________________
Product: X-Cart Gold
Current version: 4.0.14

Additional Mods: X-Affiliate
Reply With Quote