Try our conversational search powered by Generative AI!

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
fuji - Sep 11, 2019 10:55
Perfect! Thanks :)
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.