AI OnAI Off
Haven't verified it. But worth a try I guess:
public class CustomContentTypeModelScanner : ContentTypeModelScanner { public CustomContentTypeModelScanner( ITypeScannerLookup typeScannerLookup, ContentTypeModelRegister typeModelRegister, ContentModelValidator modelValidator, ContentTypeModelRepository contentTypeModelRepository, IContentTypeModelAssigner contentTypeModelAssigner, ContentDataInterceptorHandler modelTypeInterceptorHandler, ContentDataInterceptor modelTypeInterceptor, TemplateModelRepository templateModelRepository, IContentTypeModelFilter[] filters, IEnumerable<ContentScannerExtension> registerExtensions, IAvailableModelSettingsRepository availableContentTypeService) : base( typeScannerLookup, typeModelRegister, modelValidator, contentTypeModelRepository, contentTypeModelAssigner, modelTypeInterceptorHandler, modelTypeInterceptor, templateModelRepository, filters, registerExtensions, availableContentTypeService) { } protected override bool DeleteUnusedContentTypes { get { return false; } } } [InitializableModule] [ModuleDependency(typeof(InitializationModule))] public class SwapContentTypeModelScannerModule : IConfigurableModule { public void Initialize(InitializationEngine context) { } public void Uninitialize(InitializationEngine context) { } public void ConfigureContainer(ServiceConfigurationContext context) { context.Container.Configure(ctx => ctx.For<IContentTypeModelScanner>().Use<CustomContentTypeModelScanner>()); context.Container.Configure(ctx => ctx.For<ContentTypeModelScanner>().Use<CustomContentTypeModelScanner>()); } }
Thanks!
Didn't think of that, I will test it out and just wrap the configuration so that it only registers if there is a app settting telling it to do so :-)
The above code works perfectly!
We just wrapped the Configure with a check against App Settings so that we cna disable the behavior when needed.
Thanks for the help.
PS: for some reason I can't mark your post as an Answer..
Noble of you Valdis, but for the sake of the quality of the forum, I'm marking it anyway :-)
Hi
We have been trying out working against a single EPiServer database in development, and it works fine in most instances.
But there is one major problem
Content Type Synchronization
the problem is that new Content Types are deleted by the syncronization when sombody doesn't have the new content type and starts the site.
Example one
Would it be possible to add an option to the Content Type Syncronization that disables the delete part of the syncronization?