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 }
|
This works for me using version 4.1.6. Can anyone show me how to keep the 2nd level subcategories showing, all the time? Thanks in advance.