View Single Post
  #17  
Old 09-20-2005, 12:16 AM
 
ExoZed ExoZed is offline
 

Member
  
Join Date: Apr 2005
Posts: 28
 

Default Sub-sub categories

To display further sub-subcategories you could just add a section loop within the existing 'subcat' section loop. This seems a bit convoluted but haven't had time to figure it out properly - there would be a much nicer way to do it in include/categories.php if you were to sort an array properly. But for anyone not bothered, smarty seems to be fast enough to handle doing all these loops...

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} {section name=subsubcat loop=$allcategories} {if $allcategories[subsubcat].parentid eq $allcategories[subcat].categoryid} >{$allcategories[subsubcat].category} {/if} {/section} {/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 }

It's the section loop called 'subsubcat' that adds these categories, with a > infront of the name. This is the only thing I added to do this.
__________________
--------------------------------------------


4.0.14-gold_upgrade
Reply With Quote