RapidFire Posted June 28, 2010 Share Posted June 28, 2010 I am trying to set up my categories block so that clicking on the Parent category causes the subcategories to drop down, and then clicking on the subcategory takes you to the product page.As of now, I have all links disabled in the categories block, and I did this by following this post: Hello,Solution:1st step - edit file 'category-tree-branch.tpl', located in yourshop/modules/blockcategories/replace {$node.name|escape:htmlall:'UTF-8'} with {$node.name|escape:htmlall:'UTF-8'} 2rd step - edit file'global.css', located in yourshop/themes/prestashop/css/remove or comment classes div#categories_block_left span.OPEN { background: no-repeat left top url('../img/icon/less.gif'); } div#categories_block_left span.CLOSE{ background: no-repeat left top url('../img/icon/more.gif'); } div#categories_block_left span.grower{ display:block; float:left; background-position: 0px 3px; background-repeat: no-repeat; width:9px; height:15px; margin: 0 0 0 -10px!important; margin: 0 0 0 -6px; padding: 0; } Is there some sort of modification I can make to the LINK code (see below) so that only the subcategories behave as links?{$node.name|escape:html:'UTF-8'} *EDIT*Googled "prestashop node ids" and found this post. Looks like it might be my answer. Will try momentarily. Try changing 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 depth=1 last='true'} {else} {include file=$branche_tpl_path node=$child depth=1} {/if} then change line 2 of modules/blockcategories/category-tree-branch.tpl from: <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 $depth > 1}{/if} to: {if $depth > 1}<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 $depth > 1}{/if} and lines 6-10 of modules/category-tree-branch.tpl 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 depth=$depth+1 last='true'} {else} {include file=$branche_tpl_path node=$child depth=$depth+1 last='false'} {/if} Yep, this worked Link to comment Share on other sites More sharing options...
webkoala Posted August 16, 2010 Share Posted August 16, 2010 Hi there i cant make it work. Would you like to upload your files? Link to comment Share on other sites More sharing options...
sokpet Posted August 19, 2010 Share Posted August 19, 2010 Everything works perfect. Thanks. But there are 2 more things. 1. How to make all subcategories closed by default and make parent category to work like open/close button?2. How to change SITEMAP and delete the links of parent category, because over there the PARENT category page still accesable? Link to comment Share on other sites More sharing options...
Guidiap Posted March 11, 2011 Share Posted March 11, 2011 Arrrrrr thanks indeed but it's not what you wanted in the first post & what we want !! Thanks for the help thought."sokpet" is right, it's almost the solution but to act like a tree-menu we need >> "How to make all subcategories closed by default and make parent category to work like open/close button?"But thanks anyway, I will search further... Link to comment Share on other sites More sharing options...
josias Posted April 9, 2011 Share Posted April 9, 2011 Doesn't work in PS1.4 Link to comment Share on other sites More sharing options...
Guidiap Posted April 10, 2011 Share Posted April 10, 2011 josias haven't you read this post, I make it (french) :http://www.prestashop.com/forums/viewthread/44547/integration/resolu_liens_dans_le_menu/I can't figure out if it works on 1.4 but it must be the same deal. Check my website if we are in the same issue now solved.Bye Link to comment Share on other sites More sharing options...
josias Posted April 10, 2011 Share Posted April 10, 2011 josias haven't you read this post, I make it (french) :http://www.prestashop.com/forums/viewthread/44547/integration/resolu_liens_dans_le_menu/I can't figure out if it works on 1.4 but it must be the same deal. Check my website if we are in the same issue now solved.Bye Thank you! Link to comment Share on other sites More sharing options...
sakrafanas Posted November 8, 2011 Share Posted November 8, 2011 Code below makes linkable only subcategories: file: category-tree-branch.tpl <li {if isset($last) && $last == 'true'}class="last"{/if}> {if $node.children|@count > 0} {$node.name|escape:htmlall:'UTF-8'} <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> {else} <a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a> {/if} </li> Link to comment Share on other sites More sharing options...
idofri Posted December 20, 2012 Share Posted December 20, 2012 (edited) wrong topic Edited December 21, 2012 by idofri (see edit history) 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