通过迁移创建新的内容类型,添加到他的内容字段,但它们未显示在仪表板中。
仪表板中的内容类型视图:
我的代码有什么问题?
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;
}