All about Microsoft Office SharePoint Server Content Type – Part 1

In this article I would like touch upon the following areas.

  • What is a content type
  • How content types work
  • Extending content types
  • Attaching Workflows to a content type
  • Attaching event handlers to a content type
  • Deploying a content type as a feature

What is a Content Type:

A content type is a reusable settings that describe the shared behaviors for a specific type of content. or in other words Content types enables us to manage the metadata and behavior of a document or a list item type in a centralized manner, that is reusable.

Content types can be defined for documents, list items, folders. Content types can be used organize content across multiple lists and libraries across the site collection. Also a list or a library can contain references to multiple Content types.

How Content types work:

Content Type Terminologies:

  • Site Content type – Content types are created at the site level and they act as a template which can be instantiated in a list under a sub site.
  • List Content type – The instance of the Site content type is called a list content type. When we add a site content type to a list SharePoint creates a copy of the Site content type  onto the list.
  • Content type scope – The scope depends on the site where the content type is created. The content type is then available to all the sub sites.
  • Parent content type – All the content types follow a hierarchy. The following image(Fig – Base content type hierarchy) shows the relationship between the different content types. Ultimately all the content types inherit from System content type.
  • Groups – Categorizing content types into groups to make it easier for users to find them.(Fig – Content Type Groups)

Base content type hieararchy

Fig – Base Content type hierarchy

image

Fig – Content Type Groups

 

Creating a new List Content Type :

In this example we are going to create a new content types called Project Task

  • Go to the Site or Site Collection top level site where you want to create the content type.
  • On the Site Actions menu click Site Settings
  • In the Galleries column select Site content types

image

 

  • This opens the gallery listing all the existing site content types, click Create
  • Enter the Content type name as ‘Project Task’ and choose ‘List Content Types’ group and ‘Item’ as the Parent Content Type and click OK.

  image

  • The content type gets saved and navigates to the admin page of the content type. Go to Columns section and click ‘Add from new site column’. We will now create new site columns to be added to this content type.

image

 

  • Add 2 columns Project Task – Single line of text, Project Details – Multiple lines of text.

image

image

  • Go to the custom list to which we are going to associate this new content type.
  • Click Settings->List Settings->Choose Advanced settings from the General Settings section.
  • Make sure that the ‘Allow management of content types’ is selected.

image

image

  • Get back to the settings page and select ‘Add from existing site content types’

image

  • Choose the ‘Project Task’ from the list box and click ‘Add’ and click OK.
  • Now we are done with associating a content type with the list.

image

  • Now when you click ‘New’ from the list’s all items view page you will see an option ‘Project Task’

image

  • This opens a new item page with the columns that we associated with the content type.

image

  • At this point the list has instantiated a copy of ‘Project Task’ content type. Lets see how it behaves when we update the content type. Let us add a new column called ‘Task Owner’.  Go To Site Actions->Site Settings->Site Content Types->Select the ‘Project Task’ content type->Go to columns Section and click ‘Add from new site column’.

image

image

  • Enter ‘Task Owner’ in the column name and choose ‘Person or Group’ and make sure the ‘Update all content types inheriting form this type’ is selected.(default selection)
  • Go back to the Project Tasks list which uses the ‘Project Task’ content type->Click New Project Task. Here you will see the newly updated column Task Owner appearing in the form.

image

Creating a new Document Content Type :

In this example we are going to create 2 new document content types called Project Proposal and Technical Design and associate it with a document library named Project Documents 

  • Go to the Site or Site Collection top level site where you want to create the content type.
  • On the Site Actions menu click Site Settings
  • In the Galleries column select Site content types
  • This opens the gallery listing all the existing site content types, click Create
  • Enter Project Proposal as the name of the content type and choose Document under the Document Content Types group. Click OK.

image

  • The content type gets saved and navigates to the admin page of the content type. Go to Settings section and click ‘Advanced Settings’. We can associate a document template that is available in the site or can associate a document template from your local computer. In this case I have chosen to associate a .dotx template i have in my local drive.

image

image

  • Repeat the above steps and add a new content type called ‘Technical Design
  • Go to the ‘Project Documents’ document library to which we are going to associate the content types. Click Settings->Document Library Settings->Advance Settings->Make sure that the Allow Management of content types is selected.

image

  • From the content types section choose ‘Add from existing site content types’
  • Select ‘Project Proposal’ and ‘Technical Design’ from the Available site content types. Click OK

image

  • Remove the default document content type.
  • Go to the Project Documents library and now you will have 2 options in the ‘New’ menu option.

image

Creating a new Folder Content Type :

Now imagine that we should have 2 folders, one for the Project Proposal Documents and one for the Technical Design Documents. And those folders should host only the respective type of documents.

  • Go to the Site or Site Collection top level site where you want to create the content type.
  • On the Site Actions menu click Site Settings
  • In the Galleries column select Site content types
  • This opens the gallery listing all the existing site content types, click Create
  • Enter ‘Proposal Documents’ as the name of the content type and choose Folder under the Folder Content Types group. Click OK.
  • Create another folder content type with another name ‘Proposal Documents’

image

  • Go to the Project Documents library->Document Library Settings->Under the content types click ‘Add from existing site content types’.
  • Select ‘Design Documents’ and ‘Proposal Documents’ and click OK

image

  • Go back to the Project Documents library->Document library settings->Advanced Settings->Set the Display ‘New Folder’ to No.
  • Go back to the Project Documents library and click ‘New’ you will now see the 2 new folder content types.

image

image

  • Create a new Folder for Design Documents. Lets say we name it as ‘Design Docs – 2009
  • Select ‘Change New Button Order’ option from the folder context menu.

image

  • Choose ‘Technical Design’ (document content type we added earlier. refer to the creating a document content type in this same article) and unselect all other content types

image

  • Now when we click ‘New’  in the Design Docs – 2009 folder you will see the ‘Technical Design’ document as the only option.

image

* To be continued in Part 2 of the post

Useful Links:

Part – 1 , Part – 2 , Part – 3 , Part – 4

Advertisements

3 Responses

  1. […] All about Microsoft Office SharePoint Server Content Type – Part 1 […]

  2. […] All about Microsoft Office SharePoint Server Content Type – Part 1 […]

  3. […] Content Type – Part 4 Posted on March 17, 2009 by Karthikeyan Kasiviswanathan In the part 1 of the article we […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: