Content types in SharePoint

Content types in SharePoint can be extended by creating a new feature which deploys an element file with the following content:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <ContentType ID="GUID"
        Name="Text"
        Group="Text"
        Version="0">
        <FieldRefs>
            <FieldRef ID="GUID" Name="Text"/>
        </FieldRefs>
    </ContentType>
</Elements>

The content type Id includes the GUID of the Parent content type. The base content type (System) has an Id of 0x. The Id is built up as follows:

Option 1

[ParentGUID][01]
[ParentGUID][02]
[ParentGUID][03]

Option 2

[ParentGUID]00[GUID]

Out of the box examples for the first format are as below:

 

Content TypeGUIDInherits fromComment
System0x
Item0x01System
Document0x0101Item
Form0x010101DocumentIn the resource files this is referred to as an XML Document
Picture0x010102Document
Untyped Document0x010104Document
Unknown Document Type0x010105DocumentAlso called untyped Document
User Workflow Document0x010107Document
Wiki Page0x010108DocumentAlso called Wiki document
Basic Page0x010109Document
Web Part Page0x01010901Basic Page
Link to a document0x01010ADocument
Far East Contact0x010116Document
Dublin Core Columns0x01010BDocument
Event0x0102Item
Issue0x0103Item
Announcement0x0104Item
Link0x0105Item
Contact0x0106Item
Message0x0107Item
Task0x0108Item
Workflow Task0x010801Task
Admin Task0x010802Task
Workflow history0x0109Item
Blog post0x0110Item
Blog Comment0x0111Item
Folder0x0120Item
Discussion0x012002Folder
Summary Task0x012004Folder
Document Set0x0120d5Folder
Person0x010AItem
SharePoint Group0x010BItem
Domain Group0x010CItem

Examples of the second format are:

Content TypeGUID
Office Data Connection File0x010100629D00608F814dd6AC8A86903AEE72AA
Universal Data Connection File0x010100B4CBD48E029A4ad8B62CB0E41868F2B0
Health rule definition0x01003A8AA7A4F53046158C5ABD98036A01D5
Health report0x0100F95DB3A97E8046b58C6A54FB31F2BD46
Schedule0x0102007dbdc1392eaf4ebbbf99e41d8922b264
Resource Reservation0x0102004f51efdea49c49668ef9c6744c8cf87d
ScheduleAndResourceReservation0x01020072bb2a38f0db49c3a96cf4fa85529956
GbwCirculationCTName0x01000f389e14c9ce4ce486270b9d4713a5d6
GbwOfficialNoticeCTName0x01007ce30dd1206047728bafd1c39a850120
CallTracking0x0100807fbac5eb8a4653b8d24775195b5463
Resource0x01004c9f4486fbf54864a7b0a33d02ad19b1
ResourceGroup0x0100ca13f2f8d61541b180952dfb25e3e8e4
Holiday0x01009be2ab5291bf4c1a986910bd278e4f18
Timecard0x0100c30dda8edb2e434ea22d793d9ee42058
WhatsNew0x0100a2ca87ff01b442ad93f37cd7dd0943eb
Whereabouts0x0100fbeee6f0c500489b99cda6bb16c398f7
IMEDictionaryItem0x010018f21907ed4e401cb4f14422abc65304
XSL Style0x010100734778F2B7DF462491FC91844AE431CF

Which format should be used?

SharePoint uses the long GUIDs when you create a new content type however it does mean that you might end up with very long set of characters making it almost impossible to manage. Personally I prefer the short version however I also like to follow the standard set by SharePoint. The only real limitation of the short version of the Content type ID is that you can only inherit 254 times from a base content type.

The main thing to consider there is that when the next release of SharePoint comes out will there be any duplicate Id in use in your solution. Therefore to avoid duplicate IDs use a long GUID when you create base content type which extends an out of the box content type (such as Item or Document). Then when you extend your base content type you can use 01, 02, 03 etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 4,912 other subscribers

Recent Posts

Archive

Thank you for visiting SharePains

%d bloggers like this: