London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
You can hide standard elements from editors in this way
[InitializableModule] [ModuleDependency(typeof(EPiServer.Web.InitializationModule))] public class HideFormElements : IInitializableModule { public void Initialize(InitializationEngine context) { Type[] formElementsToHide = new Type[1] { typeof(TextboxElementBlock) }; var contentTypeRepository = ServiceLocator.Current.GetInstance<IContentTypeRepository>(); foreach (var type in formElementsToHide) { var contentType = contentTypeRepository.Load(type); if (contentType.IsAvailable) { var clone = (ContentType)contentType.CreateWritableClone(); clone.IsAvailable = false; contentTypeRepository.Save(clone); } } } public void Uninitialize(InitializationEngine context) { } }
Hi,
In the solution I'm working with we have a need to add an extra property field to many of the form elements. After we extend each element and add the extra property we would like to replace the standard element block (from Forms) with the new block that we've created; so that site editors can only add our customized element to the form.
Is this possible to achieve?
Thanks!