nick2010 Posted August 27, 2010 Share Posted August 27, 2010 Hi,Is it possible to display a module in the sidebar of 1 page only, without having to add every page but one to the module Exceptions list ? Link to comment Share on other sites More sharing options...
rocky Posted August 28, 2010 Share Posted August 28, 2010 The only other way is use Smarty to hide the module code on every page but the one you want. For example, to show a module only on the homepage, add the following to the top of the module's TPL file: {if $page_name == 'index'} and the following to the bottom: {/if} Link to comment Share on other sites More sharing options...
magma Posted January 28, 2011 Share Posted January 28, 2011 Hi Rocky,I am wondering how I would go about using the above code in my modules tpl file if I just want to have it appear on one particular CMS page. ie. cms.php?id_cms=4 So if I just want the block I am using (in my case the advertising block) to show up on that page only, what would the code I would use be?Thanks for your help! Link to comment Share on other sites More sharing options...
rocky Posted January 29, 2011 Share Posted January 29, 2011 Use the following at the top of modules/blockadvertising/blockadvertising.tpl: {if $smarty.get.id_cms == 4} and the following at the bottom: {/if} Link to comment Share on other sites More sharing options...
magma Posted January 29, 2011 Share Posted January 29, 2011 Thank you so much Rocky! You are Awesome! worked like a charm! Link to comment Share on other sites More sharing options...
arvindBHANWALA Posted January 29, 2011 Share Posted January 29, 2011 hello sir, can u plz help me..as i m new to prestashop and need help in modify some modules for my website... i have read your posts and thought that u can help me... i need it for my school project...plz help Link to comment Share on other sites More sharing options...
afazmin Posted January 5, 2013 Share Posted January 5, 2013 Thanks rocky! i've been searching for days. I thought it had something to do with hooks. finally i got to display side adv banner only in category page {if $smarty.get.id_category == 7} <!-- MODULE Block advertising7 --> <div class="advertising_block"> <a href="{$adv_link}" title="{$adv_title}"><img src="{$image}" alt="{$adv_title}" title="{$adv_title}" width="202" height="500" /></a> </div> <!-- /MODULE Block advertising7 --> <!-- /title="{$adv_title}" width="155" height="163" /></a> --> {/if} Still, i prefer to place the banner at the centre instead of right side, just below the HOME>MY CATEGORY, and only in my category page. Can anybody help me with that? i know that theres an option at BO to insert image for category, but it just display image, can't insert link. tried this http://nemops.com/a-deeper-look-at-prestashop-hooks/ but didn't work 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