I’ve inherited an old website after the previous developer passed away. Foolish perhaps but they are good people doing good things in our community so I offered to help.
The site uses an old version of Tinymce.
I’m trying to update the signup form to use Constant Contact.
The code I’m trying to add is as follows: <script> var _ctct_m = "32ee443d65507d7f14ad26d121f10e50"; </script> <script id="signupScript" src="//static.ctctcdn.com/js/signup-form-widget/current/signup-form-widget.min.js" async defer></script>
On posting, the editor modifies the code, stripping the src tag and adding CData tags as below: <script type="text/javascript">// <![CDATA[ var _ctct_m = "32ee443d65507d7f14ad26d121f10e50"; // ]]></script> <script id="signupScript"></script>
Regardless to say; this does not work.
I’ve modified the setting options in the mce_editor.js file; setting ‘cleanup’ to 0, and ‘validate html’ to false. There is a ‘script[src|type’ tag in the valid elements list but the problem persists.
There is another file called mce_serializer.js which has a ‘valid_elements : '[]' setting which looks about right.
The mce_init.js file doesn’t seem to have anything that would cause the editor to strip the code.
I've seen a possible solution at https://stackoverflow.com/questions/28983735/how-can-i-prevent-tinymce-from-adding-cdata-to-script-tags-and-from-commenting but it doesn't explain in which file I should add this code. Perhaps our Tinymce versions differ.
Anyone have any advise on how I can I make this work?