ipete Posted January 11, 2014 Share Posted January 11, 2014 Hi I am trying to make exception for categories module only for one cms page. How could i do this in 1.5.6.1 version of PrestaShop? Link to comment Share on other sites More sharing options...
vekia Posted January 11, 2014 Share Posted January 11, 2014 it's not possible to define exception for "certain" cms pages only (with default features in BO) in this case, it's necessary to modify module template file. {assign var='hidemodule' value='0'} {if isset($smarty.get.controller)} {if $smarty.get.id_cms==3} {assign var='hidemodule' value='1'} {else} {assign var='hidemodule' value='0'} {/if} {if} where id_cms is an id of page, where you want to hide module then you can use there code: {if $hidemodule!=1} CONTENTS OF TPL HERE {/if} Link to comment Share on other sites More sharing options...
ipete Posted January 12, 2014 Author Share Posted January 12, 2014 it's not possible to define exception for "certain" cms pages only (with default features in BO) in this case, it's necessary to modify module template file. {assign var='hidemodule' value='0'} {if isset($smarty.get.controller)} {if $smarty.get.id_cms==3} {assign var='hidemodule' value='1'} {else} {assign var='hidemodule' value='0'} {/if} {if} where id_cms is an id of page, where you want to hide module then you can use there code: {if $hidemodule!=1} CONTENTS OF TPL HERE {/if} Hi Thank you for such fast answer but i didnt get any result Maybe you could show me how should it look in code This is my module code: <!-- Block categories module --> <div id="categories_block_left" class="block"> <p class="title_block">{l s='Categories' mod='blockcategories'}</p> <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> {* Javascript moved here to fix bug #PSCFI-151 *} <script type="text/javascript"> // <![CDATA[ // we hide the tree only if JavaScript is activated $('div#categories_block_left ul.dhtml').hide(); // ]]> </script> </div> </div> <!-- /Block categories module --> Link to comment Share on other sites More sharing options...
vekia Posted January 12, 2014 Share Posted January 12, 2014 {assign var='hidemodule' value='0'} {if isset($smarty.get.controller)} {if $smarty.get.id_cms==3} {assign var='hidemodule' value='1'} {else} {assign var='hidemodule' value='0'} {/if} {if} {if $hidemodule!=1} <!-- Block categories module --> <div id="categories_block_left" class="block"> <p class="title_block">{l s='Categories' mod='blockcategories'}</p> <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> {* Javascript moved here to fix bug #PSCFI-151 *} <script type="text/javascript"> // <![CDATA[ // we hide the tree only if JavaScript is activated $('div#categories_block_left ul.dhtml').hide(); // ]]> </script> </div> </div> <!-- /Block categories module --> {/if} try with this - remember about changing ID of cms page Link to comment Share on other sites More sharing options...
ipete Posted January 12, 2014 Author Share Posted January 12, 2014 {assign var='hidemodule' value='0'} {if isset($smarty.get.controller)} {if $smarty.get.id_cms==3} {assign var='hidemodule' value='1'} {else} {assign var='hidemodule' value='0'} {/if} {if} {if $hidemodule!=1} <!-- Block categories module --> <div id="categories_block_left" class="block"> <p class="title_block">{l s='Categories' mod='blockcategories'}</p> <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> {* Javascript moved here to fix bug #PSCFI-151 *} <script type="text/javascript"> // <![CDATA[ // we hide the tree only if JavaScript is activated $('div#categories_block_left ul.dhtml').hide(); // ]]> </script> </div> </div> <!-- /Block categories module --> {/if} try with this - remember about changing ID of cms page Thank you Before I tried the same but still have blank screen after using this code Link to comment Share on other sites More sharing options...
vekia Posted January 12, 2014 Share Posted January 12, 2014 it was probably some typo, anyway, does it work now? Link to comment Share on other sites More sharing options...
ipete Posted January 12, 2014 Author Share Posted January 12, 2014 (edited) it was probably some typo, anyway, does it work now? no site absolutely stop work after i put this code Edited January 12, 2014 by ipete (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 13, 2014 Share Posted January 13, 2014 i checked code once again, try with this: {assign var='hidemodule' value='0'} {if $smarty.get.id_cms==3} {assign var=hidemodule value='1'} {else} {assign var=hidemodule value='0'} {/if} {if $hidemodule!=1} <!-- Block categories module --> <div id="categories_block_left" class="block"> <p class="title_block">{l s='Categories' mod='blockcategories'}</p> <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> {* Javascript moved here to fix bug #PSCFI-151 *} <script type="text/javascript"> // <![CDATA[ // we hide the tree only if JavaScript is activated $('div#categories_block_left ul.dhtml').hide(); // ]]> </script> </div> </div> <!-- /Block categories module --> {/if} Link to comment Share on other sites More sharing options...
ipete Posted January 13, 2014 Author Share Posted January 13, 2014 i checked code once again, try with this: {assign var='hidemodule' value='0'} {if $smarty.get.id_cms==3} {assign var=hidemodule value='1'} {else} {assign var=hidemodule value='0'} {/if} {if $hidemodule!=1} <!-- Block categories module --> <div id="categories_block_left" class="block"> <p class="title_block">{l s='Categories' mod='blockcategories'}</p> <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> {* Javascript moved here to fix bug #PSCFI-151 *} <script type="text/javascript"> // <![CDATA[ // we hide the tree only if JavaScript is activated $('div#categories_block_left ul.dhtml').hide(); // ]]> </script> </div> </div> <!-- /Block categories module --> {/if} Thank you very much again! Link to comment Share on other sites More sharing options...
vekia Posted January 13, 2014 Share Posted January 13, 2014 hope that now it will work for you well let me know Link to comment Share on other sites More sharing options...
ipete Posted January 13, 2014 Author Share Posted January 13, 2014 hope that now it will work for you well let me know it is working well Thank you Link to comment Share on other sites More sharing options...
vekia Posted January 13, 2014 Share Posted January 13, 2014 yeah! finally thanks for confirmation im going to mark this topic as solved if you will need any additional assistance to this modification - just let me know here with regards, Milos 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