-
Hello everybody, I'm looking for suggestions for adding named parts to a content type. Now, I got to a point where I don't know how to add a named part to a content type in the migrations class. _contentDefinitionManager.AlterTypeDefinition(nameof(FooterWidget), type => type
.DisplayedAs("Footer")
.Creatable()
.Listable()
.Draftable()
.Securable()
.WithSettings(new FullTextAspectSettings
{
IncludeBodyAspect = true,
IncludeDisplayText = true
})
.WithPart(nameof(TitlePart), part => part
.WithSettings(new TitlePartSettings
{
RenderTitle = true,
Options = TitlePartOptions.Editable
})
)
.WithPart(nameof(FooterWidget))
.WithPart(nameof(BagPart), part => part
.WithDisplayName("Columns")
.WithDescription("Adds a column to your footer.")
.WithSettings(new BagPartSettings(){ContainedContentTypes = new []{ "FooterColumn" }})
)
); In this example code the last "BagPart" needs to get another technical name. I'm open for some ideas from the community. Maybe someone had a similar issue and can help me here. I'm trying to avoid any configurations involving JSON files. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found the solution, I just had to give an additional string into the WithPart method. .WithPart("ThisIsACustomTechnicalName", nameof(BagPart), part => part
.WithDisplayName("Columns")
.WithDescription("Adds a column to your footer.")
.WithSettings(new BagPartSettings(){ContainedContentTypes = new []{ "FooterColumn" }})
) |
Beta Was this translation helpful? Give feedback.
Found the solution, I just had to give an additional string into the WithPart method.