Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to create my main Document Types programmatically on ApplicationStarted.
Is it possible to set Composition of a ContentType programmatically?
you need to lookup the other ContentType and add it to a collection of IContentTypeCompositions and then assign this to the ContentTypeComposition value of the parent content type.
So for example (assuming you have a contentTypeService refrence)
List<IContentTypeComposition> compositions = new List<IContentTypeComposition>();
var myComp = contentTypeService.GetContentType(compAlias);
myContentType.ContentTypeComposition = compositions;
you can see this (and a bit more) in the uSync source - as it does this on import of content types from disk.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted