Jump to content

(Solved) Issues with moving slider to HomeTab


Recommended Posts

Trying to get the image slider over the home tabs. Found this page https://www.prestashop.com/forums/topic/450576-how-to-put-the-home-slider-on-the-right-side-of-the-homepage/

 

If I insert the php code into the homeslider.php file I can transplant the module but the image slider stops working.

 

Looking at the html source it seems the slider module gets attached to the tabs UL

<div id="center_column" class="center_column col-xs-12 col-sm-9">
<ul id="home-page-tabs" class="nav nav-tabs clearfix">
<div id="homepage-slider">

I've attached a screen shot and the site URL is here http://greenearthgardensupplies.com/

 

post-1258723-0-17435500-1464928336_thumb.png

 

 

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

I believe I tried that and get the slider on the bottom of the page but can't move it up above the tabs BUT it also breaks the slider and each slide image gets stacked on top of each other. I'll test it again in a few hours and see if there are any JS errors but I didn't see any.

Link to comment
Share on other sites

Ok after some testing still not working and not getting any JS errors. Selecting Home only allows you to have the banner at the bottom of the home page and can't move it up hence the new hook in the link I posted.

 

Link to comment
Share on other sites

You can edit index.tpl in the theme folder, and take HOOK_HOME above the tabs, I guess?

 

 

Already tried that no go. Looks like I'll have to add a new hook and add it to the design http://blog.premium-templates.eu/creating-custom-hooks-in-prestashop-1-5-1-6-the-easy-way

 

Once that's done I could insert something like this

 

 

{if isset($HOOK_SLIDER) && $HOOK_SLIDER|trim}

    <div class="clearfix">{$HOOK_SLIDER}</div>

{/if}

 

 

Into the index.tpl above the tabs

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

Ok here's the easy solution.

 

Get this module Hook Manager https://mypresta.eu/modules/administration-tools/hooks-manager.html it doesn't really do much except to create hooks and registers them in the DB which saves you from having to add the registration in a module.

 

So create a hook say CenterTop and save it.

 

Now in homeslider.php add this, save and upload.

	public function hookCenterTop($params)
	{
		return $this->hookdisplayTopColumn($params);
	}

Open index.tpl in your theme directory and add this

<div class="clearfix">{hook h='CenterTop'}</div>

To this

{if isset($HOOK_HOME_TAB_CONTENT) && $HOOK_HOME_TAB_CONTENT|trim}
    {if isset($HOOK_HOME_TAB) && $HOOK_HOME_TAB|trim}
        <ul id="home-page-tabs" class="nav nav-tabs clearfix">
			{$HOOK_HOME_TAB}
		</ul>
	{/if}
	<div class="tab-content">{$HOOK_HOME_TAB_CONTENT}</div>
{/if}
{if isset($HOOK_HOME) && $HOOK_HOME|trim}
	<div class="clearfix">{$HOOK_HOME}</div>
{/if}

To make it look like this

<div class="clearfix">{hook h='CenterTop'}</div>
{if isset($HOOK_HOME_TAB_CONTENT) && $HOOK_HOME_TAB_CONTENT|trim}
    {if isset($HOOK_HOME_TAB) && $HOOK_HOME_TAB|trim}
        <ul id="home-page-tabs" class="nav nav-tabs clearfix">
			{$HOOK_HOME_TAB}
		</ul>
	{/if}
	<div class="tab-content">{$HOOK_HOME_TAB_CONTENT}</div>
{/if}
{if isset($HOOK_HOME) && $HOOK_HOME|trim}
	<div class="clearfix">{$HOOK_HOME}</div>
{/if}

Save and upload.

 

Now in the backend go to modules and positions. Click on Transplant Module (top right corner) and then select Module > Image Slider and Transplant To > CenterTop then save. Back to positions one more time. Select image slider for your homepage at the top of the page. It'll list the hooks where the slider is hooked to. Unhook it from the displayTopColumn section.

 

Now go back to modules, search for slider and disable and re-enable it. This will active the new hook.

 

Now go back to Modules and Slider, click configure and then set the image width to 870 if you are only using the slider and not Theme Configurator also.

 

That should be it.

 

post-1258723-0-38450000-1465107678_thumb.png

 

or you can see it live at http://greenearthgardensupplies.com/
 

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