Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
The following example shows how it is possible to replace a component for the entire system, and in this particular example how the built-in EPiServer CMS page tree can be replaced with a custom page list component. The registration required is done in an initialization module using the IOC container.
C#
// A simple component implementation represented with a dijit content pane on the client side
public class MyCustomPageList : ComponentBase
{
public MyCustomPageList() : base("dijit/layout/ContentPane")
{
// Add "Hello World!" as non-persisted content to the dijit content pane
this.Settings.Add(new Setting("content", "Hello World!", false));
}
}
public void ConfigureContainer(ServiceConfigurationContext context)
{
context.Container.Configure(container =>
{
container.For<IComponent>().Add<MyCustomPageList>()
.Named(new PageTreeComponent().DefinitionName);
});
}
Last updated: Jul 09, 2014