Jump to content

Adding Javascript to the Home Text Editor and CMS pages


Recommended Posts

Hi,

 

I'd like to be able to add the odd bit of javascript to a page created in the Home Text Editor or the CMS pages, for example adding a simple lightbox javascript to images in the CMS pages and homepage.

 

When building a regular HTML site I would usually place the javascript in the Header and then call the script from within the main HTML body code.

 

Am I correct that in Prestashop I'd need to add the javascript code to the header.tpl file

and then call the script from within the CMS HTML code?

 

The problem I'm having is that in both the Home Text Editor and the CMS page editor in Prestashop (is it TINYMCE?) it strips out the javascript code each time I update it?

 

Is there a way of getting the TINYMCE editor in Prestashop to ignore the javascript and leave it intact in the code. Do I need to update a file in TINYMCE to allow this?

 

I've looked in the forums but I can't find the answer to this one - I'm possibly not searching using the correct terms.

 

I hope someone can help?

 

Thanks in advance

 

Brian

Link to comment
Share on other sites

I would usually place the javascript in the Header and then call the script from within the main HTML body code.

 

The problem I'm having is that in both the Home Text Editor and the CMS page editor in Prestashop (is it TINYMCE?) it strips out the javascript code each time I update it?

 

If your installation compatible, download this module and use header block to insert any javascript, or any other block to insert and HTML, JS or CSS content Disclosure: module is built by me.

 

Stopped developing modules. See here

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

  • 2 months 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...