0
通过迁移创建新的内容类型,添加到他的内容字段,但它们不显示在仪表板中。在仪表板OrchardCMS-未添加内容字段以自定义内容类型编程
内容类型的看法:
有什么错我的代码?
public int UpdateFrom2() {
var name = "ProductViaCode";
ContentDefinitionManager.AlterPartDefinition(
string.Format("{0}Part", name),
b => b
.Attachable()
.WithField("ProductId", cfg => cfg
.OfType("InputField")
.WithDisplayName("Product Id")));
ContentDefinitionManager.AlterTypeDefinition(
name, cfg => cfg
.WithPart(typeof(CommonPart).Name)
.WithPart(typeof(AutoroutePart).Name)
.WithPart(typeof(BodyPart).Name)
.WithPart(typeof(TitlePart).Name)
.WithPart(typeof(MenuPart).Name)
.Creatable()
.Draftable()
.Listable()
.Securable());
return 3;
}
看来您已经忘记将您的ProductViaCodePart添加到您的类型中。 – Xceno