3

I'm trying to configure a rich text field to allow script tags for a demo section on the page.

I added the following settings and linked this to the field

    {
  buttons: ['html','bold','italic','unorderedlist','orderedlist','link','image'],
  plugins: ['fullscreen'],
  toolbarFixedBox: true,
  replaceDivs: false,
  paragraphize: false,
  replaceDivs: false,
  deniedTags: [],
  removeComments: false,
  cleanSpaces: false,
  cleanOnPaste: false,
  removeDataAttr: false
}

However, The script tag is still always removed on save. Is there some other setting i am missing?

  • Why do you use a Redactor field for JS scripts to run on your site? – carlcs Jun 9 '15 at 15:55
  • 2
    Following @carlcs's comment - it seems like you'd be better off putting the script code in a plain text field instead of fighting to get the WYSIWYG to let them though. – Brad Bell Jun 9 '15 at 18:44
3

Script tags should be put in plain text field types (if they need to be editable by the client at all, otherwise put them in the templates).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.