I combined some code from
here and
here
The results almost achieve what I want, but still not exactly.
Now it looks like:
-------------------------
CATEGORIES
-------------------------
FLOWERS
CAKE
-------------------------
-------------------------
OCCASIONS
-------------------------
BIRTHDAY
LOVE
-------------------------
(click "flower" or "cake" will show its subcategories)
But for some reason, there is a blank area between "OCCASIONS" and "BIRTHDAY". And it's too close for "CAKE" and "OCCASIONS".
There is another headache. In order to achieve this, I set all the occasions as root categories, and set the first occasion's POS. as 900.
But by this way, it's too confusing for product management in backend. I'd like to setup a root categories as "Shop by Occasions" and all the occasions as subcategries. "Shop by Occasions" should appear as a seperate block instead of a category.
Any help how can I modify the code?
Below is my current categories.tpl:
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}
<TABLE cellpadding="0" cellspacing="0" width="100%" border="0">
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
{if $categories[cat_num].order_by eq 900}
{capture name=menu}
{/capture}
<TR><TD valign="top" colspan="3">
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_occasions_categories menu_content=$smarty.capture.menu }
</TD>
</TR>
{/if}
<TR>
<TD valign="top">
[img]{$ImagesDir}/custom/blue_arr.gif[/img]</TD>
<TD>
<FONT class="CategoriesList">
{$categories[cat_num].category}</FONT>
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{section name=subcat loop=$allcategories}
{if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}
{$allcategories[subcat].category}
{/if}
{/section}
{/if}
</TD>
</TR>
<TR>
<TD colspan="2">[img]{$ImagesDir}/custom/menu_splitter.gif[/img]
</TD>
</TR>
{/section}
{else}
{section name=cat_num loop=$subcategories}
<TR>
<TD valign="top">[img]{$ImagesDir}/custom/blue_arr.gif[/img]</TD>
<TD>
<FONT class="CategoriesList">
{$subcategories[cat_num].category}</FONT>
</TD>
</TR>
<TR>
<TD colspan="2">[img]{$ImagesDir}/custom/menu_splitter.gif[/img]
</TD>
</TR>
{/section}
{/if}
</TABLE>
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }
Thanks in advance!