For a current project we really need to use the composition functionality to allow a doctype to inherit from multiple others. Although these emtods existin the API they arent wired in the V6 backoffice ad the changes will only come through with the new project Belle UI.
Using a mixins type aproach I have wire dup the add composition method so one doc type can be 'composed' into another. This works great and changing the inherited doctype does push the changes onto the inheritor.
Removes a ContentType with the supplied alias from the the list of composite ContentTypes.
//Given a `ContentTypeService` object get a ContentType by its alias and
//remove the 'Meta' ContentType from its composition.
var contentType = contentTypeService.GetContentType("textPage");
bool success = contentType.RemoveContentType("meta");
if(success)
contentTypeService.Save(contentType);
V6 API IContentTypeService.RemoveContentType
Hey,
For a current project we really need to use the composition functionality to allow a doctype to inherit from multiple others. Although these emtods existin the API they arent wired in the V6 backoffice ad the changes will only come through with the new project Belle UI.
Using a mixins type aproach I have wire dup the add composition method so one doc type can be 'composed' into another. This works great and changing the inherited doctype does push the changes onto the inheritor.
So in summary this works a charm:
.AddContentType(IContentTypeComposition contentType)
However I'm struggling with remove functionality, it doesnt seem to work. I've also made sure there isnt any content on this doctype.
From here http://our.umbraco.org/documentation/reference/management-v6/Models/ContentType :
.RemoveContentType(string alias)
Removes a
ContentType
with the supplied alias from the the list of composite ContentTypes.Anyone else tried this?
I think I've found a bug, reported on youtrack http://issues.umbraco.org/issue/U4-1690
For anyone else I'm working round it ATM with reflection
is working on a reply...