meserlian Posted November 11, 2013 Share Posted November 11, 2013 Hi, Trying to exclude a specific category (id 169) from the category block, but can't seem to figure it out. www.cyoffers.com Link to comment Share on other sites More sharing options...
El Patron Posted November 11, 2013 Share Posted November 11, 2013 will 'disabling' the category from the back office work for you? Link to comment Share on other sites More sharing options...
meserlian Posted November 11, 2013 Author Share Posted November 11, 2013 My Bad, I would like to disable from the left navigation, but still be able to access it from the top navigation. Thanks for the quick reply. Link to comment Share on other sites More sharing options...
vekia Posted November 12, 2013 Share Posted November 12, 2013 hello you can do it only with template modification file. let me know what ps version you use and what module version you've got i will prepare code for you Link to comment Share on other sites More sharing options...
meserlian Posted November 12, 2013 Author Share Posted November 12, 2013 Hi Vekia, That would be great!! PS 1.5.6.0 Categories Block V2.0 -Garen Link to comment Share on other sites More sharing options...
vekia Posted November 12, 2013 Share Posted November 12, 2013 great! here is the code: {if $node.id != 20} <li {if isset($last) && $last == 'true'}class="last"{/if}> <a href="{$node.link|escape:'htmlall':'UTF-8'}" {if isset($currentCategoryId) && $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|strip_tags|trim|escape:'htmlall':'UTF-8'}">{$node.name|escape:'htmlall':'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> {/if} code above {if $node.id != 20} means: if category id is different than 20, then display link. so the category with id will be hidden. 2 Link to comment Share on other sites More sharing options...
meserlian Posted November 13, 2013 Author Share Posted November 13, 2013 That is Great. Does that go into the theme template folder or Module Folder? Link to comment Share on other sites More sharing options...
vekia Posted November 13, 2013 Share Posted November 13, 2013 if this file exists in your there directory, you have to edit this one (it's due to the overriding feature http://doc.prestashop.com/display/PS15/Overriding+default+behaviors#Overridingdefaultbehaviors-Overridingotherbehaviors ) Link to comment Share on other sites More sharing options...
contempoweb Posted August 1, 2014 Share Posted August 1, 2014 great! here is the code: {if $node.id != 20} <li {if isset($last) && $last == 'true'}class="last"{/if}> <a href="{$node.link|escape:'htmlall':'UTF-8'}" {if isset($currentCategoryId) && $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|strip_tags|trim|escape:'htmlall':'UTF-8'}">{$node.name|escape:'htmlall':'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> {/if} code above {if $node.id != 20} means: if category id is different than 20, then display link. so the category with id will be hidden. What if we want to exclude more than one category? Link to comment Share on other sites More sharing options...
vekia Posted August 2, 2014 Share Posted August 2, 2014 What if we want to exclude more than one category? add additional conditions in if clause: {if $node.id != 20 || $node.id !=21 || $node.id !=99 || $node.id=129} etc. 1 Link to comment Share on other sites More sharing options...
lm59 Posted August 18, 2014 Share Posted August 18, 2014 (edited) Hello,Thank you {if $node.id != 11 } {if $node.id != 11 AND $node.id != 13 AND $node.id != 14 AND $node.id != 15 } Thank you Edited August 18, 2014 by lm59 (see edit history) 1 Link to comment Share on other sites More sharing options...
contempoweb Posted August 18, 2014 Share Posted August 18, 2014 Im59, try this format: {if $node.id != 11 AND $node.id !=13 AND $node.id !=14 AND $node.id !=15} Link to comment Share on other sites More sharing options...
francklecancre Posted November 2, 2014 Share Posted November 2, 2014 Hi, and thank you for your post UP for 1.6 I would like authorised only one category from categories block OR I would like masked specific category from categories block any one ? many thanks regards Link to comment Share on other sites More sharing options...
Loonary Posted November 28, 2014 Share Posted November 28, 2014 (edited) Hi, and thank you for your post UP for 1.6 I would like authorised only one category from categories block OR I would like masked specific category from categories block any one ? many thanks regards I would like to know this as well... Trying to exclude two categories from the category block in 1.6.0.9. P.S: Figured it out . Edited November 28, 2014 by Loonary (see edit history) Link to comment Share on other sites More sharing options...
neerajlm10 Posted January 28, 2015 Share Posted January 28, 2015 Hey i want to remove image from one category and display images for all other category..How can i do that?i brought the images to block category left.i want to remove the image from one category from there. Link to comment Share on other sites More sharing options...
vekia Posted January 28, 2015 Share Posted January 28, 2015 Hey i want to remove image from one category and display images for all other category..How can i do that?i brought the images to block category left.i want to remove the image from one category from there. what is your code at the moment? can you show it ? + for what category (id) you want to disable these images? by images you mean cateogry heading image? Link to comment Share on other sites More sharing options...
neerajlm10 Posted January 29, 2015 Share Posted January 29, 2015 Hi Vekia <li {if isset($last) && $last == 'true'}class="last"{/if}> <a href="{$node.link|escape:'html':'UTF-8'}"{if isset($currentCategoryId) && $node.id == $currentCategoryId} class="selected"{/if} title="{$node.desc|strip_tags|trim|escape:'html':'UTF-8'}"><img src="{$link->getCatImageLink($category->link_rewrite, $node.id)}"/> {$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> This is my category-tree-btanch.tpl and the underlined part is the code i added to bring the category image to the category block left. But currently 'categories with no image added' is displaying thumbnail with no image.i have attached that image with this. so i want to write a conditon so that if no image is added to the category only the category name should be shown and the thumbnail is not shown. hope u understand the problem .Pls help me Sorry im not able to upload that image an error msg is coming.I hope u got what i meant with the thumbnail with no image. Link to comment Share on other sites More sharing options...
neerajlm10 Posted January 29, 2015 Share Posted January 29, 2015 hey I did it for now with the condition {if $node.id!=3}.But can i get a general condition? Link to comment Share on other sites More sharing options...
vekia Posted January 29, 2015 Share Posted January 29, 2015 this is block categories, there is no images by default im lost a little. you use some customization of this module? Link to comment Share on other sites More sharing options...
bvtonline Posted January 29, 2015 Share Posted January 29, 2015 Can you help me please? - How to insert products from affiliate stores such as - amazon, ebay....? - Did you know a module, where I can insert my ID from: amazon, ebay..... etc, and automatically insert products Link to comment Share on other sites More sharing options...
neerajlm10 Posted January 30, 2015 Share Posted January 30, 2015 (edited) HI vekia.. I have attached a screen shot of my page with this.In that in category block there is no image added to category giftcard.but its displaying a thumbnail like that.I want to remove that. I want a general if condition so that if no image is added to category it shouldnot display a thumbnail like that. I am not using a customized version.the images added to a category from backoffice is displayed there in the category block.The code for that is in my yesterday's post. Pls help Edited January 30, 2015 by neerajlm10 (see edit history) Link to comment Share on other sites More sharing options...
Zengorius Posted September 6, 2015 Share Posted September 6, 2015 Hi everyone, my solution for Prestashop 1.6.x si here: 1. I created 3 categories (with id 80, 81 and 82 as well) 2. I edited some lines in blockcategories.tpl file like this: This: <div class="block_content"> <ul class="tree {if $isDhtml}dhtml{/if}"> {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} </ul> </div> To this: <div class="block_content"> <ul class="tree {if $isDhtml}dhtml{/if}"> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $child.id !=80} {if $child.id !=81} {if $child.id !=82} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child} {/if} {/if} {/if} {/if} {/foreach} </ul> </div> Shape {if $child.id !=80 || $child.id !=81 || $child.id !=82} didnt work for me, but you can try it This is not total cosher solution, but absolutly works Link to comment Share on other sites More sharing options...
SaLiC Posted November 2, 2015 Share Posted November 2, 2015 Hi, it is not working for me in 1.6.0.14 :/ Is there another solution? Link to comment Share on other sites More sharing options...
crisalid Posted November 8, 2015 Share Posted November 8, 2015 not working for me in 1.6.0.14 also Link to comment Share on other sites More sharing options...
SaLiC Posted December 23, 2015 Share Posted December 23, 2015 I cant get this working in 1.6.0.14 either. Is there another solution to try?? // Sara Link to comment Share on other sites More sharing options...
SaLiC Posted December 23, 2015 Share Posted December 23, 2015 Sorry it is working for me in 1.6.0.14! I made a typo, that is why is was not working Link to comment Share on other sites More sharing options...
StefArts Posted June 30, 2016 Share Posted June 30, 2016 Hi everyone, my solution for Prestashop 1.6.x si here: 1. I created 3 categories (with id 80, 81 and 82 as well) 2. I edited some lines in blockcategories.tpl file like this: This: <div class="block_content"> <ul class="tree {if $isDhtml}dhtml{/if}"> {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} </ul> </div> To this: <div class="block_content"> <ul class="tree {if $isDhtml}dhtml{/if}"> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $child.id !=80} {if $child.id !=81} {if $child.id !=82} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child} {/if} {/if} {/if} {/if} {/foreach} </ul> </div> Shape {if $child.id !=80 || $child.id !=81 || $child.id !=82} didnt work for me, but you can try it This is not total cosher solution, but absolutly works This solution works perfectly on PS 1.6.1.6 Thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts