Hi guys,
I have a simple category list on the left of my site which shows all categories, works perfect.
However, i need it to function more like a menu.
When entering a sub category, i want to keep showing the root cat's and only expand the category i am in, all closed cat's not showing.
For example, i clicked pants, then color.
- Mens clothing (Clicked)
-- Pants
---- Blue
---- Black
---- Pink (Clicked) - last of the subcategories.
-- Socks (List is closed)
-- Shirts (List is closed)
- Womans clothing (list is closed)
- Child clothing (list is closed)
I currently have only this to go on and can't for the life of me figure out how to do it in smarty, i'm not a big smarty person i must say.
Anyone have a good idea as how to start or point me in the right direction?
{if $subcategories} {math equation="ceil(n/c)" assign="rows" n=$subcategories|count c=3|default:"3"} {split data=$subcategories size=$rows assign="splitted_subcategories"}
-
{foreach from=$splitted_subcategories item="ssubcateg"}
{foreach from=$ssubcateg item=category name="ssubcateg"}
{if $category}
- {if $category.main_pair} {include file="common/image.tpl" show_detailed_link=false images=$category.main_pair no_ids=true image_id="category_image" image_width=24 image_height=24 class="ty-subcategories-img" } {else} {/if} {$category.category} {/if} {/foreach} {/foreach}