I'm trying to get a list of the properties of a document type. I'm a bit stuck though.
I can see the IPropertyType has a collection"PropertyGroupCollection" and within that "PropertyType" collection, and within that The propties I'm after... But how to I get to them something like....
IContentType ict = Services.ContentTypeService.GetContentType("MyDoc");
it depends a bit on where you are and what you are after :
on a ContentType you can loop through ict.PropertyTypes
e.g
foreach(var property in ict.PropertyTypes)
{
// do things
}
however if you might want all the property types (include those that might have been inherited from other content types if you have compisitions)
for this you should use ict.CompositionPropertyTypes which will list all the properties you would see if you where looking at a content item in the back office.
Get List of Document Type Properties
Hi,
I'm trying to get a list of the properties of a document type. I'm a bit stuck though.
I can see the IPropertyType has a collection"PropertyGroupCollection" and within that "PropertyType" collection, and within that The propties I'm after... But how to I get to them something like.... IContentType ict = Services.ContentTypeService.GetContentType("MyDoc");
TIA Rich.
Hi Rich
it depends a bit on where you are and what you are after :
on a ContentType you can loop through
ict.PropertyTypes
e.g
however if you might want all the property types (include those that might have been inherited from other content types if you have compisitions)
for this you should use
ict.CompositionPropertyTypes
which will list all the properties you would see if you where looking at a content item in the back office.Amazing thanks Kev.
is working on a reply...