Reputation: 13
I have Custom Content Type in Orchard, with coresponding part of same name with two text fields, defined in migrations. The part definition is as follows:
ContentDefinitionManager.AlterPartDefinition("Faq",
cfg => cfg
.Attachable()
.WithField("Question", f => f
.OfType("TextField")
.WithDisplayName("Question")
.WithSetting("Flavor","Wide"))
.WithField("Answer", f => f
.OfType("TextField")
.WithDisplayName("Answer")
.WithSetting("Flavor", "Html"))
This adds the fields to the part, but the setting is not applied - both fields have the default flavor in the dashboard. I believe it is just a silly typo but I'm unable to figure it out.
Upvotes: 0
Views: 183
Reputation: 6581
Yeah, adding fields in migrations can be a little fiddly. What you really need is instead of just "Flavor", you need its fully qualified name, "TextFieldSettings.Flavor".
I've actually started adding a feature to Orchardizer (a VS extension) that will transform your export code into migrations code, so it'll build all that stuff for you. Should be done by the weekend (if I don't start feeling lazy)
Upvotes: 1