PrestaShop Forums: Javascript into product description - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


Javascript into product description


Javascript into product description

#1 ash84

    PrestaShop Newbie

  • 08 Oct 2009
  • Members
  • Pip
  • 3 posts

Posted 21 January 2010 - 11:33 AM

Hello,

If I try to call a JavaScript function into the HTML of a product description, i get error:

the field description (English (English)) is invalid

How can I solve this?

Thank you.

#2 rocky

    PrestaShop Superstar

  • 16 Oct 2008
  • US Moderators
  • 9981 posts
  • Location:Australia

Posted 22 January 2010 - 04:33 AM

Javascript is disabled by default in TinyMCE for security reasons. If you are the only person who can edit content using the Back Office and know what you are doing, go to js/tinymce/jscripts/tiny_mce/tiny_mce.js, look for the "valid_elements" section and add script[language|type|src] to end like this to enable javascript.

valid_elements:"@[id|class|style|title|dir

Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

Guides Performance Guide | Installation Guide | Development Guide

Modules AJAX Sliding Categories | AJAX Dropdown Categories | Carousel | Image Gallery | Sliding Menu

All free and paid software, modules, themes and modifications are subject to the terms and conditions here.

#3 jselva

    PrestaShop Newbie

  • 14 Feb 2010
  • Members
  • Pip
  • 13 posts

Posted 15 February 2010 - 10:37 AM

Hi Rocky, I try to find this your code, but, i have 1.2.5 prestashop version, your code is the same? all it's ok until

"script[language|type|src]"

I dont have this...

I'm trying to install a video gallery, but i cant...

#4 rocky

    PrestaShop Superstar

  • 16 Oct 2008
  • US Moderators
  • 9981 posts
  • Location:Australia

Posted 15 February 2010 - 11:44 AM

@jselva

It normal for you to be missing that code. You are supposed to add it on the end so that TinyMCE doesn't remove <script> tags.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

Guides Performance Guide | Installation Guide | Development Guide

Modules AJAX Sliding Categories | AJAX Dropdown Categories | Carousel | Image Gallery | Sliding Menu

All free and paid software, modules, themes and modifications are subject to the terms and conditions here.

#5 jselva

    PrestaShop Newbie

  • 14 Feb 2010
  • Members
  • Pip
  • 13 posts

Posted 15 February 2010 - 12:02 PM

Thanks Rocky, but i cant...

Appeare the same error,I attach my "tiny_mce.js"

My shop is in Spanish, there isn't a problem, no?

Thanks again.

Attached File(s)



#6 jselva

    PrestaShop Newbie

  • 14 Feb 2010
  • Members
  • Pip
  • 13 posts

Posted 15 February 2010 - 12:08 PM

Rocky, your module carrousel it's fantastic, but, when I download it from your website, download without the extension ".rar" ;)

#7 rocky

    PrestaShop Superstar

  • 16 Oct 2008
  • US Moderators
  • 9981 posts
  • Location:Australia

Posted 16 February 2010 - 01:41 AM

You've got your valid_elements set to * [ * ] for some reason. You can try replacing it with the above code, but if your existing code means that all elements are accepted, then your problem isn't caused by TinyMCE filtering the script. There must be another problem preventing the module from working.

The extension should actually be .zip. This is a bug in Prestashop v1.2.5. I'll have to check whether it has been fixed in Prestashop v1.3 alpha 1. I'll report it to the bug tracker if it still doesn't work.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

Guides Performance Guide | Installation Guide | Development Guide

Modules AJAX Sliding Categories | AJAX Dropdown Categories | Carousel | Image Gallery | Sliding Menu

All free and paid software, modules, themes and modifications are subject to the terms and conditions here.

#8 Star

    PrestaShop Addict

  • 01 Jan 2009
  • Members
  • PipPipPip
  • 618 posts
  • Location:California

Posted 16 February 2010 - 05:39 AM

From 1266231760:

Thanks Rocky, but i cant...

Appeare the same error,I attach my "tiny_mce.js"

My shop is in Spanish, there isn't a problem, no?

Thanks again.


If you know what you are doing. And you feel comfortable with the database. Enter the JS directly into the DB. That is what I did. http://www.blossomca...hydrangeas.html insides the more detail tab...

#9 mandrin

    PrestaShop Apprentice

  • 31 Oct 2009
  • Members
  • PipPip
  • 165 posts

Posted 03 March 2010 - 03:17 AM

I still get "the field description (English (English)) is invalid" even though I added "script[language|type|src]"
tinymca will not let me add javascript

#10 rocky

    PrestaShop Superstar

  • 16 Oct 2008
  • US Moderators
  • 9981 posts
  • Location:Australia

Posted 12 March 2010 - 05:28 AM

Good news everybody! Prestashop v1.3 beta 1 now allows Javascript in the product description. We just have to wait for v1.3 final to be released before using it on a live shop.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

Guides Performance Guide | Installation Guide | Development Guide

Modules AJAX Sliding Categories | AJAX Dropdown Categories | Carousel | Image Gallery | Sliding Menu

All free and paid software, modules, themes and modifications are subject to the terms and conditions here.

#11 mandrin

    PrestaShop Apprentice

  • 31 Oct 2009
  • Members
  • PipPip
  • 165 posts

Posted 13 March 2010 - 12:30 PM

WOOT!!!! Awesome news!

#12 Flux Print

    PrestaShop Newbie

  • 08 Dec 2010
  • Members
  • Pip
  • 1 posts

Posted 14 December 2010 - 10:11 AM

From 1268368119:

Good news everybody! Prestashop v1.3 beta 1 now allows Javascript in the product description. We just have to wait for v1.3 final to be released before using it on a live shop.


1.3.2.3 still not supporting Javascript in editor. Any more ideas how to fix this error:the field description (English (English)) is invalid? We've done all that has been suggested here but still getting the same bloody message :( Heeeelp





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users