Source view not present after upgrading to TinyMCE editor version 2

  • Updated

After upgrading TinyMCE to version 2 the source view option is no longer present. This is expected functionality as the default settings for TinyMCE have changed between versions, and this can be configured through code as noted in the following documentation.

https://world.episerver.com/blogs/Ben-McKernan/Dates/2018/3/an-updated-tinymce-package-has-been-released/

The bellow documentation goes into the default settings of the TinyMCE editor within version 2 of the editor as implemented by Episerver:

https://world.episerver.com/documentation/developer-guides/CMS/add-ons/customizing-the-tinymce-editor-v2/default-settings/

Adding a new .cs file with the below should allow for the site to have the source view again. 


using EPiServer.Cms.TinyMce.Core;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;

namespace AlloyTemplates.Business.Initialization
{
    [ModuleDependency(typeof(TinyMceInitialization))]
    public class ExtendedTinyMceInitialization : IConfigurableModule
    {
        public void Initialize(InitializationEngine context)
        {
        }

        public void Uninitialize(InitializationEngine context)
        {
        }

        public void ConfigureContainer(ServiceConfigurationContext context)
        {
            context.Services.Configure<TinyMceConfiguration>(config => config.Default().AddPlugin("code").AppendToolbar("code"));
        }
    }
}