Pages

Monday, February 27, 2012

SharePoint 2010 - Document Management - Part 4

Introduction
The advantage of working with a SharePoint document library is the ability to store and edit documents within the library. You have the option to create a new Office document and save it directly into the library! This is really a great feature but it gets even better. You can attach templates to the library so users can create a new document based at this template. In this article I will create a project document library to demonstrate how this works.

During the creation of the library there is an option to choose the desired template:





I will just leave this at Microsoft Word for now.You can go to the ribbon and click at Documents and New Document. A new, and empty, Word document will open. You have the option to fill the document with content and save it directly into the library.

Wouldn't it be great if you can create a new Word document based at template? Let's say you have a proposal template and want to add this as a template in the project document library, how can you do this? Keep on reading!

Content types
Remember that during the creation of the document library we picked the Microsoft Word Document template? This is actually a content type. What is a content type? I like the following description:

"Content types are used to create (unique) items within a SharePoint portal"

This probably sounds a bit abstract but it is actually really easy! All the lists and libraries in SharePoint have the option to create items. For example an announcement:




The announcement is created by the announcement content type. This content type has three default columns:
  1. Title
  2. Body
  3. Expires
You can create a new content type, based at the original announcement content type, with it's own set of metadata. You can add new columns and create your own unique announcement! It's also possible to attach a workflow or information management policies to your content type.

Let's create a new content type for the proposal document so we can use it in the project document library. There is only one really important thing you need to realize. You can create a content type at site level and at site collection level. You should always create a new content type at the site collection level otherwise you can only use the content type at the selected site and sub sites. Believe me, that can be really limiting.

To create a new content type go to Site Actions and Site Settings. Under galleries you have the option Site Content Types:


I marked Announcement, Event and Tasks. You can see that a new calendar item is created by the event content type and a new task by the task content type! 

Now click at Create and the following screen will appear:


The principle of creating a new content type is, that it's a copy of an existing content type. We want to create a custom content type for our project document library. That means we have to create a copy of the document content type. Select this from the drop down list and name it Project proposal. Don't forget to create a new group for your custom content types. By doing this it is easy to locate all your custom content types. Click at OK to finish the creation process.


The project proposal content type is created and you have a couple of interesting options. You can attach a workflow or information policies such as retention or auditing. This opens so many possibilities. For this article we will stick to attaching new columns and a template.


Click at Advanced Settings:




We can upload a template and attach it to the content type. The last step we will take is creating two custom site columns! Under Columns there is the option Add from new site column. We will use this option because we are creating a new site column, there will be situations where you can use an existing one, so choose the Add from existing site column option.


We create the following two columns:
  • Project ID
  • Project name
We will set the columns at required. Also don't forget to create a new group for the custom site columns. We are now done and are ready to attach the proposal to the project document library. Go to the library and click at Library and Library Settings. Under General Settings we click at Advanced settings and select Yes at the first option so we can add new content types.

A new menu appeared:


We can now see the default content type of the project library. This is of course Document. We have two options:
  1. Add a new content type
  2. Change the order of content types
Let's say we add multiple content types, the second option allows us the change the order in the ribbon:



This is great feature because that means we can add a lot more templates related to working with project document libraries. For now we just add our newly created project proposal content type. Click at Add a new content type and choose the content type from the group (eg. Contoso Content Types) we created. This also shows why it's a great idea to create a new group, so much easier to locate our content types.

We can now delete the default Document content type because we don't need it anymore. There is an important aspect about deleting content types. We cannot delete a content type when we created a new document based at the content type. We have to delete all the documents, or attach them to another content type before being able to delete it.

Now let's create a new document! 



The users are now able to create a new proposal within the document library based at a proposal template. The document information panel shows the custom columns we created. Pretty cool stuff right?


Tips and Tricks
As always I want to conclude my article with a couple of tips and tricks:


Content type at site collection level
Always create a new content type at the site collection level so you can use the content type within every site of the portal. 

Site columns at site collection level
The same advise applies for site columns, also create these at the site collection level so you are able to use the columns within every site.

New groups
All the custom content types and site columns should be stored in an unique group. This makes locating and makes changes a lot faster. A new administrator also has an immediately view of all the custom content types and site columns of the SharePoint portal.

Child parent relationship
The content type is created at the site collection level. Every time the content type is attached to a list or library a child relationship is created. The changes made at the child level will not impact the parent. You have the option to inherit changes, for example new or changed metadata, from the parent to child. 

Deleting a content type
You can delete a child content type, this will not delete the parent. To delete the child content type it cannot be used in the list or library. All the current items or documents need to be attached to another content type. To delete the parent content type you need to remove all the child content types from the list and libraries.


Content types and multiple site collections
In SharePoint 2010 you have the option to create and share content type with multiple site collections. The content type hub can be used! A very powerful feature. Check out this blog.







4 replies:

Alistar Terry said...

Wow! Thanks for the tips and tricks. This helps me a lot. I like being organized and some document management on my files. So neat and easy to access! Thanks for this post.

Unknown said...

No problem at all :) Glad to help!

Anonymous said...

Can you have multiple document types as templates, say word, excel, powerpoint etc?

Unknown said...

Hi,

Yes, that is no problem at all.

Post a Comment