View Single Post
  #48  
Old 01-05-2004, 07:21 PM
 
jordan0 jordan0 is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: San Francisco, CA
Posts: 77
 

Default A new problem...

I love the way Boomer's DHTML menu solution looks and functions Б─⌠ letting the customer check out the subcats without having to load a new page is cool.
However, I have been trying to find a way to modify it so that it doesn't dump all of my nested subcategories under the main category. For example, If i've got
Code:
Model Kits/Cars/Ford /Honda /Toyota /etc...
And you click "Model Kits" in the category menu, I want it to just show "Cars". Right now, every category that has the root_category_name of "Model Kits" is lumped into the same list of subcategories.
How do I make it so that only the first level of subcats is displayed? Is this information stored in the $subcategories array already?

Here is the relevant code from my categories.tpl:
Code:
{section name=cat_num loop=$categories} <div class="menutitle" onclick="SwitchMenu('{$categories[cat_num].categoryid}')">{$categories[cat_num].category_name}</div> <span class="sub" id="{$categories[cat_num].categoryid}"> {section name=subcat_num loop=$categories_data} {if $categories_data[subcat_num].root_category_name == $categories[cat_num].category && $categories_data[subcat_num].category_name != $categories[cat_num].category_name} <li type="square">{$categories_data[subcat_num].category_name} {/if} {/section} </span> {/section}

thanks for your help so far!
-Jordan
__________________
Jordan Sitkin
http://www.kitkraft.biz
X-Cart 4.0.18 [unix]
Reply With Quote