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 Type | GUID | Inherits from | Comment |
---|---|---|---|
System | 0x | ||
Item | 0x01 | System | |
Document | 0x0101 | Item | |
Form | 0x010101 | Document | In the resource files this is referred to as an XML Document |
Picture | 0x010102 | Document | |
Untyped Document | 0x010104 | Document | |
Unknown Document Type | 0x010105 | Document | Also called untyped Document |
User Workflow Document | 0x010107 | Document | |
Wiki Page | 0x010108 | Document | Also called Wiki document |
Basic Page | 0x010109 | Document | |
Web Part Page | 0x01010901 | Basic Page | |
Link to a document | 0x01010A | Document | |
Far East Contact | 0x010116 | Document | |
Dublin Core Columns | 0x01010B | Document | |
Event | 0x0102 | Item | |
Issue | 0x0103 | Item | |
Announcement | 0x0104 | Item | |
Link | 0x0105 | Item | |
Contact | 0x0106 | Item | |
Message | 0x0107 | Item | |
Task | 0x0108 | Item | |
Workflow Task | 0x010801 | Task | |
Admin Task | 0x010802 | Task | |
Workflow history | 0x0109 | Item | |
Blog post | 0x0110 | Item | |
Blog Comment | 0x0111 | Item | |
Folder | 0x0120 | Item | |
Discussion | 0x012002 | Folder | |
Summary Task | 0x012004 | Folder | |
Document Set | 0x0120d5 | Folder | |
Person | 0x010A | Item | |
SharePoint Group | 0x010B | Item | |
Domain Group | 0x010C | Item |
Examples of the second format are:
Content Type | GUID |
---|---|
Office Data Connection File | 0x010100629D00608F814dd6AC8A86903AEE72AA |
Universal Data Connection File | 0x010100B4CBD48E029A4ad8B62CB0E41868F2B0 |
Health rule definition | 0x01003A8AA7A4F53046158C5ABD98036A01D5 |
Health report | 0x0100F95DB3A97E8046b58C6A54FB31F2BD46 |
Schedule | 0x0102007dbdc1392eaf4ebbbf99e41d8922b264 |
Resource Reservation | 0x0102004f51efdea49c49668ef9c6744c8cf87d |
ScheduleAndResourceReservation | 0x01020072bb2a38f0db49c3a96cf4fa85529956 |
GbwCirculationCTName | 0x01000f389e14c9ce4ce486270b9d4713a5d6 |
GbwOfficialNoticeCTName | 0x01007ce30dd1206047728bafd1c39a850120 |
CallTracking | 0x0100807fbac5eb8a4653b8d24775195b5463 |
Resource | 0x01004c9f4486fbf54864a7b0a33d02ad19b1 |
ResourceGroup | 0x0100ca13f2f8d61541b180952dfb25e3e8e4 |
Holiday | 0x01009be2ab5291bf4c1a986910bd278e4f18 |
Timecard | 0x0100c30dda8edb2e434ea22d793d9ee42058 |
WhatsNew | 0x0100a2ca87ff01b442ad93f37cd7dd0943eb |
Whereabouts | 0x0100fbeee6f0c500489b99cda6bb16c398f7 |
IMEDictionaryItem | 0x010018f21907ed4e401cb4f14422abc65304 |
XSL Style | 0x010100734778F2B7DF462491FC91844AE431CF |
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.