kinglozzer/htmleditorscripts

Enable <script> tags in SilverStripe’s HtmlEditorField

Installs: 1 078

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 0

Language:JavaScript

Type:silverstripe-module

1.0.1 2015-09-24 13:35 UTC

This package is auto-updated.

Last update: 2021-10-04 15:46:53 UTC


README

Enable <script> tags in SilverStripe’s HtmlEditorField. An implementation of this PR to enable this functionality in 3.1.

Installation

composer require kinglozzer/htmleditorscripts

No extra setup is needed as this module adds <script> tags to extended_valid_elements.

Notes

  • Only set up to work with the default CMS HtmlEditorConfig instance. Copy the approach in _config.php to enable it in other config instances;
  • Prevents other editor.onSaveContent plugin events firing: as we can’t remove the SilverStripe event that strips the <script> tags (as we don’t have a variable to reference in ed.onSaveContent.remove()), we have to simply stop other events from running.