Jump to content

i want to move slider from home to header


Recommended Posts

I tried but doen't work ...

 

i get the message "This module cannot be transplanted to this hook." .

 

how to move home image slider default module to top in prestashop - tutorial

 

so you must edit file: homeslider.php in modules/homeslider directory

 

open it and paste there code attached below:

 

public function hookdisplayTop()

{

if(!$this->_prepareHook())

return;

 

// Check if not a mobile theme

if ($this->context->getMobileDevice() != false)

return false;

 

$this->context->controller->addJS($this->_path.'js/jquery.bxSlider.min.js');

$this->context->controller->addCSS($this->_path.'bx_styles.css');

$this->context->controller->addJS($this->_path.'js/homeslider.js');

return $this->display(__FILE__, 'homeslider.tpl');

}

 

you can add this before line public function hookDisplayHome()

 

 

Now you can transplant this module in back office to "Top of pages" knows as "displayTop".

 

remember to delete image slider from home hook!

Edited by vekia (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 months later...

There are two ways you can do this.

 

1. Go to Modules > Postions and click the edit icon (pencil) beside the module. On the edit page you can enter your 'Exceptions' that you do not want the module to appear on.

 

2. If you know a little php you can add an if statement like {if $page_name == 'index'}........{/if} to the module tpl.

 

Hope that helps.

 

Marty Shue

Link to comment
Share on other sites

Here is my edited bx_styles.css file, just for reference:

 

bx-window {margin-bottom:20px;}
.bx-wrapper {
margin-bottom:20px;
height:300px;
clear:both;
}
/*next button*/
.bx-next {
display:none;
position:absolute;
top:40%;
right:-50px;
z-index:999;
width: 30px;
height: 30px;
text-indent: -999999px;
background: url(gray_next.png) no-repeat 0 -30px;
}
/*previous button*/
.bx-prev {
display:none;
position:absolute;
top:40%;
left:-50px;
z-index:999;
width: 30px;
height: 30px;
text-indent: -999999px;
background: url(gray_prev.png) no-repeat 0 -30px;
}
/*pager links*/
.bx-pager {
  position: absolute;
  bottom: 20px;
bottom:40px !ie;/* hack ie7 */
right: 15px;
padding-top: 7px;
font-size:11px;
color:#666;
text-align:center;
}
.bx-pager a {
display:inline-block;
zoom:1;
margin-right: 5px;
padding:4px 0 0 1px;
height:16px;/* 19 */
width:18px;/* 19 */
font-weight:bold;
font-size: 11px;
color:#000;
text-decoration:none;
background:url(gray_pager.png) no-repeat 0 -20px;
}
/*
* End color scheme styles
*/

/*next/prev button hover state*/
.bx-next:hover,
.bx-prev:hover {
background-position: 0 0;
}
/*pager links hover and active states*/
.bx-pager .pager-active,
.bx-pager a:hover {
color:#fff;
text-decoration:none;
background-position: 0 0;
}
/*captions*/
.bx-captions {
text-align:center;
font-size: 12px;
padding: 7px 0;
color: #666;
}
/*auto controls*/
.bx-auto {
text-align: center;
padding-top: 15px;
}
.bx-auto a {
color: #666;
font-size: 12px;
}

Link to comment
Share on other sites

When you view the page, the slider is in the correct position? On Firefox, the banner is located at the end of the menu, and not under it - it is ALL the way to the right, you might have to use your scroll bar at the bottom of your browser... Under IE is seems OK, but periodically moves??? :)

 

And yes I would also like to adjust the height of the overall slider, but that is a secondary issue to the location...

 

Thanks,

 

Bob

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

  • 1 year later...

I have the homeslider in the header, but unfortunately 'clear:both;' in bx_styles.css don't push down the column content.

The whole home slider module stays like it has position: absolute; instance.

What I am possibly doing wrong?

 

post-61615-0-69694600-1398353118_thumb.png

 

I will use the opportunity instead of starting new thread ... is it possible to move the top menu bar under the homeslider?

Thanks!

 

Link to comment
Share on other sites

  • 1 year later...

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