View Single Post
  #1  
Old 04-11-2005, 04:50 AM
 
ExoZed ExoZed is offline
 

Member
  
Join Date: Apr 2005
Posts: 28
 

Default ALWAYS display first level subcats beneath root cats

I've experimented with a couple of mods on here for this, which are really great mods, but people keep asking how to get the first level subcategories displayed beneath EVERY root category ALL the time like this:

Root category 1
- subcategory 1a
- subcategory 1b
- subcategory 1c

Root category 2
- subcategory 2a
- subcategory 2b
- subcategory 2c

Root category 3
- subcategory 3a
- subcategory 3b
- subcategory 3c

So I adapted Fernandos mod to do it - it actually only required trimming it down and just adding an if statement to check each subcategory against the current root category id it's looping through.

Below is my whole skin1/categories.tpl file which is the only thing that needs modding:

Code:
{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} <FONT class="CategoriesList">{$categories[cat_num].category}</FONT> {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {$allcategories[subcat].category} {/if} {/section} {/section} {else} {section name=cat_num loop=$subcategories} <FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT> {/section} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

The above is just a mod on the original x-cart template so there's no other stuff in there to confuse the issue.
__________________
--------------------------------------------


4.0.14-gold_upgrade
Reply With Quote