Jump to content

Homeslider on CMS Page


Recommended Posts

I may have found an answer but the image is now duplicating. Can anybody provide some feedback on this?

 

Screenshot attached

 

Reference article: https://www.prestashop.com/forums/topic/385557-adding-homeslider-to-top-of-cms-pages/

https://www.prestashop.com/forums/topic/482657-why-is-the-hook-not-showing/

post-829377-0-22334200-1461107663_thumb.png

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

Getting close:

 

Inside of CmsController.php, you will need to add the javascript/css in this method.

 

public function setMedia()
    {
        parent::setMedia();
 
        if ($this->assignCase == 1) {
            $this->addJS(_THEME_JS_DIR_.'cms.js');
            $this->addJS(_THEME_JS_DIR_.'modules/homeslider/js/homeslider.js');
        }
 
        $this->addCSS(_THEME_CSS_DIR_.'cms.css');
        $this->addCSS(_THEME_CSS_DIR_.'modules/homeslider/homeslider.css');
    }
 
Slider functionality is missing now. Any thoughts?
Link to comment
Share on other sites

Final got it!

 

Here is the final code to get your cms page to have the homeslider:

 

public function setMedia()
    {
        parent::setMedia();
 
        if ($this->assignCase == 1) {
            $this->addJS(_THEME_JS_DIR_.'cms.js');
            $this->addJS(_THEME_JS_DIR_.'modules/homeslider/js/homeslider.js');
            $this->context->controller->addJS($this->_path.'js/jquery.bxSlider.min.js');
            $this->context->controller->addJqueryPlugin(array('bxslider'));
        }
 
        $this->addCSS(_THEME_CSS_DIR_.'cms.css');
        $this->addCSS(_THEME_CSS_DIR_.'modules/homeslider/homeslider.css');
        $this->context->controller->addCSS($this->_path.'bx_styles.css');
    }
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...