Jump to content

Simple categories block


Recommended Posts

Hello everyone,

I've faced a little problem with categories block. I do not need that end-less sub category system. I need categories with only one sub category. Everything is built on custom-made designer theme (tree is totally different), so I have decided to make it more clear. I've cleaned all jQuery stuff and tried to make code simplier.

blockcategories.tpl



       {foreach from=$blockCategTree.children item=child name=blockCategTree}
           {if $smarty.foreach.blockCategTree.last}
               {include file="$branche_tpl_path" node=$child last='true'}
           {else}
               {include file="$branche_tpl_path" node=$child}
           {/if}
       {/foreach}




category-tree-branch.tpl

>

{$node.name|escape:html:'UTF-8'}
   {if $node.children|@count > 0}
</pre>
<ul>
       {foreach from=$node.children item=child name=categoryTreeBranch}
           {if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last}
               {include file="$branche_tpl_path" node=$child last='true'}
           {else}
               {include file="$branche_tpl_path" node=$child last='false'}
           {/if}
       {/foreach}
</ul>
<br>   {/if}<br




The problem is, that subcategories always remains shown. I need them to be shown only, when their category is opened or one of that categories subcategory is opened. I hope I've told what is my problem clear. Maybe someone have faced similar problem?

Thank you for your patience!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...