Christa_cross Posted September 17, 2014 Share Posted September 17, 2014 Hello, I have created a new CMS page which uses javascript and css. I have also followed this tutorial: 'Extended tinyMCE rich text editor in prestashop 1.6'. I made the changes the tutorial mentioned. However my page is still not executing the javascript and the html in the cms page still seems like it is being changes. The css code is being commented out when I save the CMS page. I went into Preferences->General and turned off the HTML Purifier Library and it still did not work. Has anyone ever successfully added javascript and css to a cms page. Presta Shop 1.6 Link to comment Share on other sites More sharing options...
vekia Posted September 18, 2014 Share Posted September 18, 2014 what kind of code you're trying to use everything depends on that! Link to comment Share on other sites More sharing options...
Christa_cross Posted September 18, 2014 Author Share Posted September 18, 2014 Thank you. I have javascript files in the javascript folder and a css file on the css folder. I have added this code to the cmsControlloer.php: except I have replaced the names of my real files. And '6' is the id of my cms page. if ((int)Tools::getValue('id_cms') == 4 || (int)Tools::getValue('id_cms') == 6) {$this->addJS(_THEME_JS_DIR_.'yourjsfile.js');$this->addCSS(_THEME_CSS_DIR_.'yourcssfile.css');} It seems no matter what I do the cleaner will still come and take out my style link and comment out the javascript. I'm thinking about just learning how to write a module and somehow connecting that to my cms page.....would that work? Thank you so much for your help. I'm always amazed how you are very quick to reply to everyone. Link to comment Share on other sites More sharing options...
El Patron Posted September 18, 2014 Share Posted September 18, 2014 yes, module is the best method, for example this little tool http://www.prestashop.com/forums/topic/349962-module-javascript-js-css-css-splicer-tool/ happy developing 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