View Single Post
  #77  
Old 04-07-2006, 09:10 PM
 
BornMunson BornMunson is offline
 

Advanced Member
  
Join Date: Jan 2005
Posts: 46
 

Default

I just installed this great mod and wanted to know how I could have it so that category 1 would still show as a link even though it has subcategories?
Quote:
Originally Posted by gfiebich
Here is a version of the above mod which displays categories and subcategories (2 levels) in an "always open" state. In addition, categories which contain subcategories are not linked. For example:

Category 1 (no link)
> Subcategory A (link)
> Subcategory B (link)
Category 2 (link)
Category 3 (no link)
> Subcategory C (link)
> Subcategory D (link)

This was done in x-cart gold 4.0.16

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} {* Determine if this category has a subcategory *} {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {assign var="subs" value="yes"} {/if} {/section} {if $subs ne 'yes'} {* This category has no subcategories, so display the category name with a link *} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} {$categories[cat_num].category} {else} {$categories[cat_num].category} {/if} {else} {* This category has subcategories, so display the category name without a link *} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} <font class="VertMenuItemsBig">{$categories[cat_num].category}</font> {else} <font class="VertMenuItemsBig">{$categories[cat_num].category}</font> {/if} {/if} {* Display the subcategories *} {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}&rsaquo;{if $cat eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}{/if} {/if} {/section} {* reset the subcategory switch *} {assign var="subs" value="no"} {/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 }

Hope this is useful to someone.

-Glen
__________________
X-Cart 4.7.3
Reply With Quote