Nick Grattan's Blog

About Microsoft SharePoint, .NET, Natural Language Processing and Machine Learning

Posts Tagged ‘SharePoint PowerUser

Problem Solved: Amnesia Problem: Multiple Content Types on Libraries

with 6 comments

In this blog post I describe a problem whereby document libraries having multiple content types use the default content type when documents are saved regardless of the selected content type.

Well, thanks to Kevin at Dublin City Council, (that’s Dublin, Ireland) here’s a solution to this problem. It’s all to do with how you define the template for the content type using “Advanced Settings” for a content type:

ct3.PNG

First, if you “Upload a new document template” the problem described above does not occur. The correct content type will always be selected regardless of how many content types there are associated with the document library. However, your document template is not under version control and becomes more difficult to update using this option.

I normally use the “Enter the URL of an existing document template” and add the URL to a document library containing content type templates (let’s call it “Content Type Templates Library”). That way, if the content type template is updated in this document library the new version will immediately be used. This is the situation where the wrong content type will be selected.

To solve the problem (and this is where Kevin comes in), you need to associate the content types with the “Content Type Templates Library”. The documents representing the content type templates need to have the content type they are being used in. Let me give an example:

Say you’ve got two content types: “CT1” and “CT2” and these use document templates called “DT1.doc” and “DT2.doc” respectively. The documents “DT1.doc” and “DT2.doc” are stored in a document library called “Content Type Templates Library”. Now, you need to associate content types “CT1” and “CT2” with “Content Type Templates Library”. Further, “DT1.doc” must use “CT1” and “DT2.doc” must use “CT2”.

Once this has been setup, the content types “CT1” and “CT2” can be associated with a document library in which users will create documents. Now, new documents created by users will have the correct content type associated with them.

Advertisements

Written by Nick Grattan

October 30, 2009 at 8:27 am