BodyPart Flavor settings in Migrations (Orchard 1.6 RC)

Topics: Writing modules
Oct 25, 2012 at 2:38 AM
Edited Oct 25, 2012 at 2:39 AM

I'm using migrations in my new module and am trying to add Flavor settings as below..

 

ContentDefinitionManager.AlterTypeDefinition("Portfolio", builder =>                                          
builder
.WithPart("BodyPart") 
.WithSetting("BodyTypePartSettings.Flavor", "text"));

Part is getting added but Flavor is always being set as html... Am I doing somethings wrong?

Developer
Oct 25, 2012 at 4:42 AM

You should set the settings directly on the BodyPart, not on the content type. Try this instead:

ContentDefinitionManager.AlterTypeDefinition("Portfolio", 
builder => builder
    .WithPart("BodyPart", p => p
        .WithSetting("BodyTypePartSettings.Flavor", "text")) 
    );

Oct 25, 2012 at 9:27 PM

Right at the point pzmyd...

It worked!!! Thanks