kinglozzer / htmleditorscripts
Enable <script> tags in SilverStripe’s HtmlEditorField
Installs: 1 097
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 0
Language:JavaScript
Type:silverstripe-module
Requires
- silverstripe/framework: ^3.1
This package is auto-updated.
Last update: 2024-10-04 22:32:46 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 ined.onSaveContent.remove()
), we have to simply stop other events from running.