Lists and libraries can be defined either to use a set of columns or it can be defined to use a content type which was introduced in WSS 3.0. The content type defines the columns for a list item or row and a list can be set to use one or several different content types. This effectively allows a list to contain multiple rows with each row having a different set of columns as defined in different content types. It is important to note that content types are defined outside of lists and are consumed by a list, thus several lists can implement the same content type.
Another nice feature of content types is they are defined using an inheritance mechanism, thus a content type can is based on another content type. In fact, you cannot create a content type from scratch, you always have to inherit from another content type. When inheriting a content type, all the fields in the base/parent content type will be included in the new child content type you are defining. There are several content types provided by SharePoint you can inherit from, the core two are either a item type for lists or library types for document libraries.
A final feature is that a library content type can contain a document template which will be used when creating new items for the library, e.g. you may create a word template for a proposal and a content type for the proposal. This template document may contain default text, logos and formatting to your companies standards. When creating a new "proposal" in the library, word will create a new document based on the template that includes all your default content.
Content types can also be associated with events and workflow's making it a really powerful feature of SharePoint.
Methods of creating a content type
There are several ways to create content types, either through the front-end, through code or through a feature. The best method is to create it using CAML and a feature. This method allows you to redeploy and reuse your content type on different farms, sites and site collections. The feature method of deployment is the preferred method of deploying your content types.
Provisioning a content type with CAML and a feature
In order to create a content type you will need to create a feature with an elements manifest file, I have already written several posts on how to do this, see the "See Also" section below if you do not know how to do this.
A simple content type is easy to provision, however the trick part is to know that content types always must inherit from another content type, thus the get the characteristics of the base content type. The ID of your new content type must be created and I have written a post SharePoint - Content Type ID's on how to do this, please read this as it is important.
The next trick is to understand content types can include additional fields, however these fields must be defined as site columns, you can use the site columns that ship with SharePoint, or you can create your own as described in my post SharePoint - How to provisioning a site column with CAML.
The sample elements manifest file below, defines a site column called Customer Account Number and a Content type called Customer which inherits from a contact (0x0106). The content type customer then also includes the a optional field for the Customer Account Number.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!--Site Columns-->
<Field
ID="{63590418-87F5-4fa7-AF50-B371C88F2F56}"
Name="CustomerAccountNumber"
DisplayName="Customer Account Number"
Description="A customer account number used within the company."
Type="Text"
MaxLength="10"
Group="Grounding Site Columns"
>
</Field>
<!--Content Types-->
<ContentType
ID="0x0106000BB3F82D2A624B77833C28045F765D7A"
Group="Grounding Content Types"
Name="Customer">
<FieldRefs>
<FieldRef ID="{63590418-87F5-4fa7-AF50-B371C88F2F56}" />
</FieldRefs>
</ContentType>
</Elements>
Verifying the content type
Once you have created the feature, installed and activate the feature. Navigate to the Site Content Type Gallery in your site settings:

Notice the following when viewing your content type:
- The parent indicates it is a contact
- The columns defined in contact are in your contact.
- The new site column "Customer Account Number" is also in the content type.
See Also