Jump to content

CSS and Javascript still not working in CMS pages 1.6


Christa_cross

Recommended Posts

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

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

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