Can you add a field e.g. mediapicker or datetime to a content part in code

Topics: Customizing Orchard, Writing modules
Aug 22, 2011 at 5:45 PM

Is it possible to add a field to a content part in code? So for example you can create a content part and add other content parts as in

ContentDefinitionManager.AlterTypeDefinition("PromoBoxWidget", cfg => cfg





.WithSetting("Stereotype", "Widget"));


can i add a mediapicker field or a DateTime field using the ContentDefinitionManager?? if so i would appreciate an example.

Aug 22, 2011 at 5:47 PM
Aug 22, 2011 at 5:51 PM

thats perfect, cheers!