Working With Enterprise Content Type in SharePoint 2010

In this article we will discuss how to create a new content type, set a custom property in a Word document, associate the document to the content type as a template, and then create a new item using the document template and new content type.

A content type is a reusable collection of metadata (columns), workflow, behavior, and other settings for a category of items or documents in a Microsoft SharePoint Server 2010 list or document library. Content types enable you to manage the settings for a category of information in a centralized, reusable way. A workflow lets you attach a business process to items in a SharePoint Server 2010. This article describes content types and workflows and provides guidance about how to plan to integrate them into your SharePoint Server 2010 document management solution. A content type defines the attributes of a list item, a document, or a folder. Each content type can specify the following:

  1. Properties to associate with items of its type.
  2. Metadata to associate with items of its type.
  3. Workflows that can be started from items of its type.
  4. Information management policies to associate with items of its type.
  5. Document templates (for document content types).
  6. Custom features.

Create a Content Type

We are going to create a new site column and content type.

  1. Open your web application.
  2. Select Site Settings from the Site Actions menu.
  3. In the Galleries section, select Site Columns.
  4. Click Create.
  5. Enter Loan ID in the Name field. Select Single Line of Text as the field type, and then click OK.

    l0.gif

  6. Return to Site Settings, and then click Site content types in the Galleries section.
  7. Click Create.
  8. In the Name field, enter Loan Application.
  9. In the Select parent content type from field, select Document Content Types.
  10. In the Parent content type field, select Document.

    l1.gif

  11. On the Site Content Type Information page, click Add from existing site columns.
  12. Add the Loan ID column and click OK

Create a Document Template
 
In this task, you create a template to use with the new content type, add a property to the template matching the site column in the content type, and associate it with the content type.

  1. Create a word Document and name it Loan Application Document.
  2. Click the File tab, locate the Properties drop-down menu, and select Advanced Properties.
  3. Select the Custom tab. Enter Loan ID in the Name field. Select Text for the Type, and enter a value of 0001 in the Value field. Click Add, and then click OK.

    l3.gif

  4. Position the cursor anywhere in the body of the document. Choose Insert from the Ribbon; then Select Quick Parts >Field. In the Choose a Field section, select DocProperty. In the Field Properties section, select Loan ID, and then click OK.
  5. Save the file as a Word Template (.dotx).
  6. Open the site we created in the first step in Internet Explorer.
  7. From the Site Actions menu, select Site Settings. In the Galleries section, select Site Content Types. Under the Custom group, click the Loan Application content type.
  8. On the Site Content Type Information screen, click Advanced Properties.
  9. In the Document Template section, select upload a new document. Browse the template file we created  and select the template file.
  10. Click Open.

Create New Items Using the Content Type and Template.

 As a final step we are going to create a new list item using the Loan Application content type.

  1. Open the site in Internet Explorer.
  2. In the Quick Launch navigation pane on the left, click on any document library if you have already one, else just create a document library.
  3. Click the Library tab, and on the Ribbon, select Library Settings.
  4. If the Content Types section is not displayed, click Advanced Settings, set Allow management of content types to Yes, and then click OK.
  5. In the Content Types section, click Add from existing site content types. Add the Loan Application content type, and then click OK.
  6. Go to the document library.
  7. Select the Documents tab. On the New Document drop-down menu, select Loan Application. Word automatically opens and displays the Loan Application Document template.

Modify the value of the Loan ID value displayed in the Document Information Panel. Enter sample text and save the document. The new Loan ID value displays in the appropriate list column.