View Single Post
  #23  
Old 05-18-2006, 03:11 AM
 
sank sank is offline
 

Advanced Member
  
Join Date: May 2006
Location: West Midlands
Posts: 34
 

Default

Quote:
Originally Posted by bluski
Thanks for the mod. Just what I was seeking, and there were only old posts for older versions. So thanks, ExoZed!!!

I modified your code so that all main categories will show on home page and when you click on a main category, only the subcats for that cat will show (and stay shown!) while the main categories will always show.

I'm new to PHP and Smarty, so someone please check my code.


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> {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {$allcategories[subcat].category} {/if} {/section} {/if} {/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_content=$smarty.capture.menu }

I've tried using this in Version 4.0.18.

The links work and i get the right amount for each category. My problem is, instead of displaying the sub-category name, it just displays "Array" over and over.

Any ideas anyone?

Thanks

Dave
__________________
X-Cart Gold Version 4.1.9

www.fredsbedshed.co.uk
Reply With Quote