View Single Post
  #107  
Old 02-28-2007, 07:27 PM
 
nostraduckus nostraduckus is offline
 

Member
  
Join Date: Jan 2007
Posts: 19
 

Default Re: Categories Menu - Showing Subcategories

Well I am just over the moon. Gave it one last shot and I now have it working!

So for those of you that have 4.0.19 and want a menu like this:

CatA (link)
SubCat1 (link)
SubCat2 (link)

CatB (link)
CatC (link)

- The CURRENT category AND subcategory will be in bold
- The categories will still be in the default menu.tpl. (the code is based on awasson's menu mod..his div layer caused my head.tpl to repeat)
- Looks fine in Firefox and Internet Explorer

Here's my categories.tpl:

Code:
{capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="modules/Fancy_Categories/categories.tpl"} {assign var="fc_cellpadding" value="0"} {else} {if $config.General.root_categories eq "Y"} {foreach from=$categories item=c} ___________________________<br><br> {if $cat eq $c.categoryid || $current_category.parentid eq $c.categoryid} <font class="ProductMain"><b><a class="current" href="home.php?cat={$c.categoryid}">{$c.category}</a></b></font><br> {else} <font class="ProductMain"><a href="home.php?cat={$c.categoryid}">{$c.category}</a></font><br> {/if} {assign var=in value=$c.categoryid} {* CONDITIONAL DROP DOWN ITEMS FROM TOP CATEGORY *} {if $current_category.parentid eq $c.categoryid || $cat eq $c.categoryid} {foreach from=$allsubcategories.$in item=c } {if $cat eq $c.categoryid} &nbsp&nbsp&nbsp<font class="ProductSub"><b><a class="current" href="home.php?cat={$c.categoryid}">{$c.category}</a></b></font><br> {else} &nbsp&nbsp&nbsp<font class="ProductSub"><a href="home.php?cat={$c.categoryid}">{$c.category}</a></font> <br> {/if} {/foreach} {/if} {* /CONDITIONAL *} {/foreach} {else} {foreach from=$subcategories item=c key=catid} <a href="home.php?cat={$catid}">{$c.category}</a> {/foreach} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}

then I added these classes to skin1.css:

Code:
.ProductMain { FONT-SIZE: 12px; } .ProductSub { FONT-SIZE: 10px; }

I am really new to editing code so sorry if it's messy... would appreciate any constructive criticism.
__________________
ming@rumplequiltskin.com.au
www.rumplequiltskin.com.au
NSW, Australia
X-Cart Version 4.0.19
Reply With Quote