Jump to content

Moving homeslider to Home hook


Recommended Posts

Hi, this is my first post on this forum.

I'm trying to edit the default theme for Prestashop with moving homeslider from header to center column. I've tried copying the content of function HookDisplayHeader in the HookDisplayHome, but the only result was a blank homepage. Now I have no idea how to manage this, so maybe anyone of you guys can help me?

 

I'm using prestashop 1.6.11 with all modules updated.

 

Thanks for any help.

Edited by coneso (see edit history)
Link to comment
Share on other sites

First I suggest if you edited files for the slider you upload any files you edited from the unzipped Prestashop on your hard drive.

 

This is fairly easy as the Hook for displayHome already exist for this module, Go to Modules, Positions then in the upper right corner click on Transplant a module.

Now in the first drop down select Image slider for your homepage, in the second drop down select displayHome (Homepage content) and save.

After saving you will be back at the positions page scroll all the way to bottom and you should see displayTopColumn with the homeslider, now remove from this hook by selecting the arrow on the right and choose unhook.

You should now see your slider in the center column.

 

However if you want the slider above the Popular, Best Sellers, New Arrivals tabs you will need to hook the slider in the displayHomeTab (not the content).

This hook is not part of the slider by default but is easily added, use the code below, copy and then paste this in the homeslider.php file at around line 480.

 

public function hookDisplayHomeTab($params)
       {
         return $this->hookdisplayTopColumn($params);
       }
 
Do the same as above except in the second drop down select displayHomeTab (not displayHomeTabContent) and save.
Now remove from the displayTopColumn as before then scroll up and fing the displayHomeTab section and drag the slider to the top of list.
Your slider should now display above the Home Page Tabs.
  • Like 1
Link to comment
Share on other sites

Ok, I don't want to create another topic so I'll write this down here:

 

After moving the slider to the home hook, I want to place two vertical images in top hook, both in one row. When I add elements to this hook in Theme Configurator module, the images are being resized and put in right column - just as there is a slider on the left side, but this left side is blank, as here:

 

In Modules/Position, in displayTopColumn I have only ThemeConfigurator module.

 

I've found that the 33% width of this div is hard-coded in /modules/themeconfigurator/css/hooks.css, but changing this doesn't help - images has set width of 100%, and even after removing this atribute, they are shown one on another....

Link to comment
Share on other sites

  • 8 months later...

 

First I suggest if you edited files for the slider you upload any files you edited from the unzipped Prestashop on your hard drive.

 

This is fairly easy as the Hook for displayHome already exist for this module, Go to Modules, Positions then in the upper right corner click on Transplant a module.

Now in the first drop down select Image slider for your homepage, in the second drop down select displayHome (Homepage content) and save.

After saving you will be back at the positions page scroll all the way to bottom and you should see displayTopColumn with the homeslider, now remove from this hook by selecting the arrow on the right and choose unhook.

You should now see your slider in the center column.

 

However if you want the slider above the Popular, Best Sellers, New Arrivals tabs you will need to hook the slider in the displayHomeTab (not the content).

This hook is not part of the slider by default but is easily added, use the code below, copy and then paste this in the homeslider.php file at around line 480.

 

public function hookDisplayHomeTab($params)
       {
         return $this->hookdisplayTopColumn($params);
       }
 
Do the same as above except in the second drop down select displayHomeTab (not displayHomeTabContent) and save.
Now remove from the displayTopColumn as before then scroll up and fing the displayHomeTab section and drag the slider to the top of list.
Your slider should now display above the Home Page Tabs.

 

 

Hello! Could you help me please? After I did this I managed to insert the image slider inside of the displayHomeTab block, thank you, but after that when my page loads it not auto-selects the Popular or Best Sellers elements (no background color appears). It not loads the class 'active' on the 'li' elements after the page loads.

This is happening all the time while the image slider is upper in the module position panel and there's no problem if I place it below the popular and best sellers blocks...

 

How can I solve it? I want it to be on top of displayHomeTab.

 

Thank you and sorry for my english.

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...