Jump to content

[Solved] How can I show Homeslider on all pages?


Recommended Posts

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 by de6ir (see edit history)
Link to comment
Share on other sites

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

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;
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

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.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

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.

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

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

  • 2 weeks later...
  • 7 months later...
×
×
  • Create New...