Creating and using Custom Site Content Types in Microsoft Office Sharepoint Server 2007

Posted on 12/15/2006 @ 2:53 PM in #SharePoint by | Feedback | 7484 views

Per my last post about creating custom site columns in Microsoft Office Sharepoint Server 2007, you can go ahead and setup a number of site columns representing various details associated with a "Car". They are all in the "Cars" group. I went ahead and created another site column, Number of Cylinders - 4,6,8,10,12 (Choice).

Now let us go ahead and set up a content type.

Go ahead and click on Site Actions -> Site Settings.

When in there, click on Site Content Types under Galleries.

Then hit "Create". Give this new content type the name of "My Car".

Note that, you can choose a Parent Content Type. I am going to choose "Special Content Type\Unknown Document Type", but you could technically choose a parent content type and inherit from it. Thus if you had a content type called "Vehicle", you could use that as a parent content type, and derive two content types - Car and Motorbike out of it.

Once the new Content Type is created, go ahead and click on "Advanced Settings" for this content type. Note that under advanced settings, you can upload a new document template. NEAT !!

Well, I choose to maintain my car details as Word Documents, so I am going to upload a blank word template where I can fill in details for my cars. This is shown as below.

Now, under the settings of the very same Content Type you just created (My Car), go ahead and customize the columns. Click on "Add from existing site columns", and here is where the magic begins - choose the custom columns you've created. This is shown as below.

Great. With the Content Type setup, let us go ahead and setup a list. that can use this content type.

Go ahead and click on Site Actions -> Create.

When in there, click on "Document Library" under "Libraries".

Create a doc lib called "My Car Collection", also choose it's Document Template to be "none". When in that doc lib, click on Settings -> Doc Lib Settings

Now here is where the fun starts. Under "General Settings", click on "Advanced Settings", and choose "Allow management of content types?" to "Yes". You should see an area letting you meddle with content types as shown below.

Click on the "Add from existing site content types" link, and choose the "My Car" content type you've already created above. Click "OK".

Also go ahead and do some clean up activity, click on "Document" (the default content type) and delete that. This should make "My Car" as the default content type.

Finally - it is now time to play with the doc lib :).

When in the doc lib, click on "New", you should see a menu like below -

Go ahead and click on the My Car menu item. And guess what pops up? A document based on the template you uploaded for this content type.

What's more, you should see under document properties the rest of the fields in that list show up as an infopath form (Did you know, document properties on Word2007 docs are really infopath forms?). This is shown as below -

Awesome !! :)

Now some of you may have already picked up on this, but here's the damn cool thing.

In Sharepoint 2007, you can specify multiple content types on the same List or Document Library. In other words, you are not limited to the same metadata structure for the entire list or document library, as you used to be in Sharepoint 2003.

Sound off but keep it civil:

Older comments..


On 9/26/2007 6:21:07 PM Rehman [MVP - SharePoint] said ..
Hi,

Hope u r doing great.

I justed wanted to consult if the above has a workaround in sps 2k3. I really need to get this done in 2k3.

Hope to hear from u soon....and it would be great if u could send me an email reply....

Have a great day :)