Insert script tag through Page/Block editing view (TinyMCE)

Vote:
 

Hi,

what would be the most preferable way to support inserting of script tag through TinyMCE when editing Page/Block?

Thanks!

#207112
Sep 10, 2019 16:38
Vote:
 

Hi,

You can configure it in the initilization module.

[InitializableModule]
    [ModuleDependency(typeof(TinyMceInitialization))]
    public class TinymceCustomInitialization : IConfigurableModule
    {
        public void ConfigureContainer(ServiceConfigurationContext context)
        {
            // browser console to see settings: window.tinymce.settings;

            context.Services.Configure<TinyMceConfiguration>(config =>
            {
                config.Default()
                    .AddSetting("extended_valid_elements", "script[language|type|src]");
            });
        }

        public void Initialize(InitializationEngine context) { }

        public void Uninitialize(InitializationEngine context) { }
    }
#207114
Sep 10, 2019 17:08
fujio - Sep 11, 2019 10:55
Perfect! Thanks :)