View Single Post
  #1  
Old 08-03-2004, 11:41 AM
 
zilker zilker is offline
 

Advanced Member
  
Join Date: Feb 2003
Posts: 89
 

Default V4 - keeping first level subcategories viewable at all times

Hey all,

I'm working with the newest version of x-cart and let me start off by saying that there are a lot of improvements ~ thx x-cart team!!

Now for my delimia. I've made a couple of simple mods to the cart.

http://www.designertrends.com/temp/amish/home.php

The first is simply showing the categories in a horizontal line across the header. Here is the code:

Code:
{* $Id: categories_test.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} {section name=cat_num loop=$categories} <FONT class="CategoriesList">{$categories[cat_num].category}</FONT> {if !%cat_num.last%} <FONT class="CategoriesList">|</FONT> {/if} {/section} {/capture} { include file="menu_cat.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

The second shows available subcategories (if applicable) where the categories menu would normally go. I inserted a simple if statement in customer/home.tpl which takes the place of the categories include statment. Here is the code for that:

Code:
{if $subcategories ne "" and $current_category.category ne "" and $config.General.root_categories ne "Y"} { include file="customer/subcategories.tpl" } {/if}

You'll notice that I have added a file named subcategories.tpl within the customer directory (not to be confused with customer/main/subcategories.tpl). Here is the code for that file:

Code:
{* $Id: subcategories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} {section name=cat_num loop=$subcategories} <FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT> {/section} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_subcategories menu_content=$smarty.capture.menu }

If you follow the url I provided, it will take you to the home page. If you click on one of the categories that has a subcategory (books, videos or dolls) you'll notice the subcategories are shown on the left. That all works great and I'm pleased with it BUT when you click on a subcategory such as videos/cd audio, all of the subcategories (cd audio, dvd, video cassettes) under the root category (videos) disappear.

I would like to keep the first level subcategories visable no matter which subcategory you are in.

Any ideas or suggestions would be greatly appreciated.
__________________
~zilker

uummm...perhaps you should tell me again.

http://www.designertrends.com
Version 4.0.6
Unix
Reply With Quote