Try our conversational search powered by Generative AI!

Loading...
Area: Optimizely CMS
ARCHIVED This content is retired and no longer maintained. See the latest version here.

Recommended reading 

Configuring the default editor

[New in EPiServer.CMS.UI 7.19.0]

The default editor wrapper has been changed to be floating. This means that editors will now appear next to their respective property and only take as much size as required. The result is that we have an edit experience where you can see more of what is changing on the page as you edit the property.

However in some cases the default editor wrapper may need to be change back to the flyout. Along with changing the default we have also added the ability to configure the default editor wrapper. This must be done at initialization time before the UI is displayed so that the correct confiuration data gets sent to the interface. This is easiest done with an InitializableModule.

using EPiServer.Cms.Shell;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.Shell;

namespace MyProject.Business.Initialization
{
    [InitializableModule]
    [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
    public class UIDefaultsInitialization : IInitializableModule
    {
        public void Initialize(InitializationEngine context)
        {
            // The supported default editor wrapper types are flyout and floating.
            context.Locate.Advanced.GetInstance<CmsUIDefaults>().DefaultEditorWrapper = UiWrapperType.Flyout;
        }

        public void Preload(string[] parameters) { }

        public void Uninitialize(InitializationEngine context) { }
    }
}

In the example above you can see that on initialize we simply set the default editor wrapper property on the UI defaults object. This defaults object is stores as a singleton within the service locator.

Do you find this information helpful? Please log in to provide feedback.

Last updated: Jan 19, 2015

Recommended reading