ncyt53 Posted August 7, 2013 Share Posted August 7, 2013 Hi guys, Need help! How can I removed the closed category tree and its subcategories as well? For example:- Parent Category A - Sub category A1 - Sub category A2 - Sub category A3 - Sub category A4 Parent Category B - Sub category B1 - Sub category B2 <---eg. if this category is selected, it will automatically hide Parent Category A, Parent Category B along with their subcategories as well - Sub category B3 Parent Category C - Sub category C1 - Sub category C2 - Sub category C3 - Sub category C4 - Sub category C5 How can i do that? Right now my category-tree-branch.tpl looks like this <li class="menu-{$node.id} {if $last == 'true'}last{/if}"> <a href="{$node.link|escape:html:'UTF-8'}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a> {if $node.children|@count > 0} <ul> {foreach from=$node.children item=child name=categoryTreeBranch} {if $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> {/if} </li> Link to comment Share on other sites More sharing options...
ncyt53 Posted August 10, 2013 Author Share Posted August 10, 2013 help anyone? please? Link to comment Share on other sites More sharing options...
stottycabanas Posted August 10, 2013 Share Posted August 10, 2013 Can you provide a little more information about your issue. Firstly, why do you want certain categories/subcategories to disappear (presumably from the categories block), can you put this in context? In your example above, it seems you want B2 to disappear with the rest of B once selected - and what's supposed to happen with Category C? Link to comment Share on other sites More sharing options...
ncyt53 Posted August 11, 2013 Author Share Posted August 11, 2013 Sorry, typo error...my bad! it's supposed to hide everything in Category A and Category C and only show Parent Category B and its subcategories. Thanks for your help! Link to comment Share on other sites More sharing options...
stottycabanas Posted August 11, 2013 Share Posted August 11, 2013 Fine, but please can you say some more about what the site is for and why you want to hide the non-selected categories. Link to comment Share on other sites More sharing options...
ncyt53 Posted August 12, 2013 Author Share Posted August 12, 2013 The page is http://www.ecopeas.com.au/3-baby. I'm thinking of hiding it because as all the categories are expanded it will push the footer down and show white space below the banner. So for example in the baby category page, it will only show the category and subcategories of baby. Boy, girls and gifts and their subcategories will be hidden. Thanks in advance! Link to comment Share on other sites More sharing options...
stottycabanas Posted August 13, 2013 Share Posted August 13, 2013 I wouldn't recommend removing the other categories altogether, otherwise you lose the ability to navigate to the other categories without constantly jumping between the categories block and the top menu. Actually, when you select a category from the top menu, the categories block behaves how I believe it should work - selected category expanded with subcategories, non-selected categories just displaying the top level. That doesn't appear to generate any white space. So ideally you want to replicate that top menu logic when selecting the categories from the categories block. I don't have the technical knowledge to advise on that I'm afraid, hope someone else can help. Incidentally, your strapline says 'Organic children (children's?) clothing, as nature intended' - I don't think nature intended us to have any clothing at all! Good luck! Link to comment Share on other sites More sharing options...
ncyt53 Posted August 13, 2013 Author Share Posted August 13, 2013 Hi stottycabanas, Thanks for your reply..will look into that! Link to comment Share on other sites More sharing options...
kevin78 Posted January 2, 2014 Share Posted January 2, 2014 I need the same result any news ? Link to comment Share on other sites More sharing options...
Recommended Posts