kdmonk1 Posted April 19, 2016 Share Posted April 19, 2016 Hello Community. I would like to add the homeslider module to my CMS pages so that each page has the slider. Can someone walk me through it or provide a url to a discussion where this is done? Link to comment Share on other sites More sharing options...
kdmonk1 Posted April 19, 2016 Author Share Posted April 19, 2016 (edited) 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/ Edited April 19, 2016 by kdmonk1 (see edit history) Link to comment Share on other sites More sharing options...
kdmonk1 Posted April 20, 2016 Author Share Posted April 20, 2016 (edited) Any thoughts on what could be the problem from anyone? What I can see, the javascript is not apart of the page which is causing the image not to work correctly. How can I get the javascript to attach properly on the CMS Pages? Edited April 20, 2016 by kdmonk1 (see edit history) Link to comment Share on other sites More sharing options...
kdmonk1 Posted April 20, 2016 Author Share Posted April 20, 2016 Any one? Link to comment Share on other sites More sharing options...
kdmonk1 Posted April 21, 2016 Author Share Posted April 21, 2016 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 More sharing options...
kdmonk1 Posted April 21, 2016 Author Share Posted April 21, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now