Jump to content

Adding Homeslider to top of CMS pages


Recommended Posts

Hello,

 

i'm trying to include the Homeslider (included in the prestahop base packaging) onto the cmd pages i created.

  1. In the install function of the homeslider.php module i registered my new hook :
    ​$this->registerHook('CMSslide') 
  2. then i added my public function:
    public function hookCMSslide($params)
    {
     return $this->hookdisplayTopColumn($params);
    }
  3. Then added in my cms.tpl {hook h='CMSslide'} to display the slider

So, i think i'm doing the things quite right, but i'm also missing something, but what?

The main issue is my hook is displayed in the cms pages (if i return 'hello word' for example) but my slider is empty...

Should anybody know why?

 

Thanks a lot

GD

Link to comment
Share on other sites

Yes, in modules > positions my new hook is present.

But the main issue is not the hook in fact, in home slider.tpl, there is this line:  {if isset($homeslider_slides)}

And that's why nothing is displayed, because the var $homeslider_slides is empty on the cms pages, but why??

Link to comment
Share on other sites

The answer, in French:

http://www.prestashop.com/forums/topic/339817-affichage-du-homeslider-sur-toutes-les-pages/?hl=%2Bhomeslider&do=findComment&comment=1880102

 

Comment following lines in homslider.php

if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'index')
return;
 
and in homeslider.tpl
{if $page_name =='index'}
 
 
I should have seeked a bit more :) the answer was just there!
Thanks Vekia
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...