de6ir Posted December 13, 2014 Share Posted December 13, 2014 (edited) I want to show the homeslider on all pages. Right now it only appears on homepage. I've tried to delete the below statement in "modules/homeslider/vews/templates/hook/homeslider.tpl" and "themes/default-bootstrap/modules/homeslider/homeslider.tpl" {if $page_name =='index'}...{/if} but still the slider appears only on homepage. Is there a way to make it visible on all pages? Version: Prestashop 1.6 Edited January 5, 2015 by de6ir (see edit history) Link to comment Share on other sites More sharing options...
shacker Posted December 17, 2014 Share Posted December 17, 2014 the home hook only shows in home. you can add this code to the product-list.tpl of your theme to show in any place {include file="$tpl_dir./../../modules/homeslider/homeslider.tpl"} Link to comment Share on other sites More sharing options...
de6ir Posted December 19, 2014 Author Share Posted December 19, 2014 Adding homeslider.tpl file to ptoduct-list.tpl or to category.tpl didn't work. Link to comment Share on other sites More sharing options...
shacker Posted December 19, 2014 Share Posted December 19, 2014 homeslider.tpl have a if to use only in home page at start, you need to remove it to use in all pages (and the close of the if) Link to comment Share on other sites More sharing options...
de6ir Posted December 23, 2014 Author Share Posted December 23, 2014 I've tried inserting the following lines into the product-list.tpl and removed the if statements in the homeslider.tpl files , but still the slider is not visible other than homepage. {include file="$tpl_dir./../../modules/homeslider/views/templates/hook/homeslider.tpl"} {include file="$tpl_dir./modules/homeslider/homeslider.tpl"} Link to comment Share on other sites More sharing options...
shacker Posted December 27, 2014 Share Posted December 27, 2014 ok, you force compile? i think is related to the hookHome, some variables are passed only in homepage, so maybe need to move to hook header edit the homeslider.php, and remove this line in hookdisplaytopcolumns if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'index') return; 1 Link to comment Share on other sites More sharing options...
de6ir Posted January 5, 2015 Author Share Posted January 5, 2015 shacker's suggestion did the trick. Here are the steps I took to show the homeslider in all pages: - In \prestashop\themes\default-bootstrap\modules\homefeatured.tpl remove {if $page_name =='index'} and the closing {/if} tag at the end. - In \prestashop\modules\homeslider.php find the lines (there are two) if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'index') and change them with if (!isset($this->context->controller->php_self) || $this->context->controller->php_self == 'index') That's all. 1 Link to comment Share on other sites More sharing options...
shacker Posted January 5, 2015 Share Posted January 5, 2015 perfect. remember to change the title to solved. Regards Link to comment Share on other sites More sharing options...
cinnamon Posted May 12, 2015 Share Posted May 12, 2015 shacker's suggestion did the trick. Here are the steps I took to show the homeslider in all pages: - In \prestashop\themes\default-bootstrap\modules\homefeatured.tpl remove {if $page_name =='index'} and the closing {/if} tag at the end. - In \prestashop\modules\homeslider.php find the lines (there are two) if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'index') and change them with if (!isset($this->context->controller->php_self) || $this->context->controller->php_self == 'index') That's all. Hi! i tried this and it works but the problem is. the slider in the home page disappear. 1 Link to comment Share on other sites More sharing options...
shacker Posted May 14, 2015 Share Posted May 14, 2015 becouse you are setting to avoid index.php {if $page_name =='index' or $page_name != 'index' } this code includes all pages, or simple remove the if code, and remember to change the php Link to comment Share on other sites More sharing options...
NewAtThis Posted August 19, 2015 Share Posted August 19, 2015 shacker's suggestion did the trick. Here are the steps I took to show the homeslider in all pages: - In \prestashop\themes\default-bootstrap\modules\homefeatured.tpl remove {if $page_name =='index'} and the closing {/if} tag at the end. - In \prestashop\modules\homeslider.php find the lines (there are two) if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'index') and change them with if (!isset($this->context->controller->php_self) || $this->context->controller->php_self == 'index') That's all. This solution worked for me. Thank you for solving this problem! The only thing that caused confusion was that the first file path was wrong. Instead of "\prestashop\themes\default-bootstrap\modules\homefeatured.tpl" you need \prestashop\themes\default-bootstrap\modules/homeslider/homeslider.tpl (not homefeatured.tpl). Other than that, it worked great for me. Thanks again! Link to comment Share on other sites More sharing options...
shacker Posted August 28, 2015 Share Posted August 28, 2015 thanks for the correction Link to comment Share on other sites More sharing options...
hindo_01 Posted April 8, 2016 Share Posted April 8, 2016 thank your for solution but no matter what i tried the home slider no longer appear in home page but for the other pages it got fixed ! Link to comment Share on other sites More sharing options...
Recommended Posts