wonky Posted January 17, 2011 Share Posted January 17, 2011 Hi, I've been trying really hard to find an answer to my problem but to no avail as its a subject that is hard to search and seems that little is written about it. I'm trying to have 2 different category menus in the left column.one will have all the categories I want to use for "men" and the other for "women".I know I can make "men" + "women" subcategories then put each additional categories I need in the relevant parent category.But I want each menu to show all the "men" subcategories and I would hard code the word "men" at the top then the same for women. Any help would be very appreciated and I'm sure others would benefit from this info.I've attached a picture so you can get a better idea of what I'm talking about.Thanks in advance 1 Link to comment Share on other sites More sharing options...
rocky Posted January 18, 2011 Share Posted January 18, 2011 I suggest creating Womens and Mens categories, then add the subcategories. You will have only one block, but you can style it to look like two block in the /* Block categories */ section of global.css. Link to comment Share on other sites More sharing options...
wonky Posted January 18, 2011 Author Share Posted January 18, 2011 Hi Rocky, that would be fine, but I dont want to have the men + women be clickable I only want to show its children and their children, so 3 levels deep but only show the last 2 levels! Also how would I go about sorting out the order of these? on the pic attach "bags" wants to be first, I could easily HTML the whole menu but then the structure would be too rigid and not good if menu tittles needed changing etc.Thanks for the advice so far Link to comment Share on other sites More sharing options...
rocky Posted January 18, 2011 Share Posted January 18, 2011 Change lines 9-13 of modules/blockcategories/blockcategories.tpl from: {if $smarty.foreach.blockCategTree.last} {include file=$branche_tpl_path node=$child last='true'} {else} {include file=$branche_tpl_path node=$child} {/if} to: {if $smarty.foreach.blockCategTree.last} {include file=$branche_tpl_path node=$child first='true' last='true'} {else} {include file=$branche_tpl_path node=$child first='true'} {/if} and line 2 of modules/blockcategories/blockcategories.tpl from: <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'} to: {if !$first}<a href="{$node.link|escape:html:'UTF-8'}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{/if}{$node.name|escape:html:'UTF-8'}{if !$first}{/if} and lines 6-10 from: {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} to: {if $smarty.foreach.categoryTreeBranch.last} {include file=$branche_tpl_path node=$child first='false' last='true'} {else} {include file=$branche_tpl_path node=$child first='false' last='false'} {/if} Link to comment Share on other sites More sharing options...
wonky Posted January 18, 2011 Author Share Posted January 18, 2011 Thanks so Much Rocky that's great and works a treat hides the 1st depth great.I also worked out how to put the categories in a custom order for those that would like to know:http://www.prestashop.com/wiki/Sorting_categoriesBut now I'm unable to have a tittle "Men" between the two (shown in image attached)Here is what I have on blockcategories.tpl : [removed][removed] <!-- Block categories module --> WOMEN {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $smarty.foreach.blockCategTree.last} {include file=$branche_tpl_path node=$child first='true' last='true'} {else} {include file=$branche_tpl_path first='true' node=$child} {/if} {/foreach} <!-- /Block categories module --> and for category-tree-branch.tpl: > {if !$first}{$node.name|escape:htmlall:'UTF-8'}{/if} {if $node.children|@count > 0} </pre> <ul> {foreach from=$node.children item=child name=categoryTreeBranch} {if $smarty.foreach.categoryTreeBranch.last} {include file=$tpl_dir./category-tree-branch.tpl node=$child first='false' last='true'} {else} {include file=$tpl_dir./category-tree-branch.tpl node=$child first='false' last='false'} {/if} {/foreach} </ul> <br> {/if as you can see in blockcategories.tpl I have a <.h4>WOMEN but I need another as marked in image attached. Thank you so much for your help it has been very help full. Link to comment Share on other sites More sharing options...
rocky Posted January 19, 2011 Share Posted January 19, 2011 You copied my code wrong. There should be two if statements, not one. Use: {if !$first}<a href="{$node.link|escape:html:'UTF-8'}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{/if}{$node.name|escape:html:'UTF-8'}{if !$first}{/if} not: {if !$first}<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'}{/if} Link to comment Share on other sites More sharing options...
wonky Posted January 19, 2011 Author Share Posted January 19, 2011 ooooops my bad!!Thanks so much for the help Rocky been very much appreciated Link to comment Share on other sites More sharing options...
w3bsolutions Posted October 24, 2011 Share Posted October 24, 2011 Great thread. Thanx Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now