SUBSCRIBE to Windows IT Pro Magazine & SAVE 30%     Register today for your FREE 'To The Point' SharePoint eNewsletter
     

     
Skip Navigation Links.
Collapse Office and SharePointOffice and SharePoint
Expand Newsletter ArchivesNewsletter Archives
Expand Office 2007Office 2007
Expand Office 2003Office 2003
Collapse SharePointSharePoint
Expand Installation and DeploymentInstallation and Deployment
SharePoint Extends a Nonprofit’s Reach
How to change your personal information in MOSS 2007
KPI's in Microsoft Office SharePoint Server 2007
Expand Integrating SharePoint and Microsoft Office 2003Integrating SharePoint and Microsoft Office 2003
Diving Into the Windows SharePoint Services 3.0 API
Hide custom list items
Linking to documents in another document library
Custom Web Part Basics
Expand Integrating SharePoint and Microsoft Office 2007Integrating SharePoint and Microsoft Office 2007
Testing Our Web Part Base Class
Expand Working OfflineWorking Offline
Installing Microsoft's Application Templates
Manage quick menu item using EditControlBlock in WSS 3.0
Expand Windows SharePoint Services Document LibrariesWindows SharePoint Services Document Libraries
Creating and Using a New Column Type
Corporate Blogging
SharePoint 2007 Content Types
Windows SharePoint Services Out of the Box
More About SharePoint 2007 Content Types
Using Content Types in Windows SharePoint Services 3.0
SQL storage planning & monitoring (MS white paper)
Display the user name for the logged on user
Outlook 2007 and SharePoint Synchronization
Use Kerberos to Secure MOSS 2007
10 Important Kerberos Facts
Stsadm
SSRS and MOSS 2007
Shared Tasks Lists with SharePoint and Outlook 2007
Introducing the Business Data Catalog
Information Integration: SSRS and MOSS 2007
What Can I Accomplish with Other SharePoint Technologies?
Integrate SharePoint into Your Exchange Environment
Outlook and SharePoint: Playing Well Together
SharePoint Integration with Outlook 2007, Part 3
Bridge the SharePoint File-Restore Gap
Migration Glitch in SharePoint Portal Server
Windows SharePoint Services 3.0 Out of the Box
SharePoint Security Evolution
Creating and Using a New Content Type in SharePoint 2007
Announcements
     

     

     

Creating and Using a New Content Type in SharePoint 2007

Creating and Using a New Content Type in SharePoint 2007

Submitted By: Bob Mixon, MSD2D SharePoint Community Manager and Managing Director of ShareSquared, Inc.
Posted On: 12/11/2006

This week, I want to show you how to create and use a content type in Microsoft Office SharePoint Server 2007. I'm going to follow through with the example for creating a column type that I gave in last week’s newsletter--a Document Library that provides the ability to select from one of two documents, each having a unique template associated with it.

From the Site Actions menu, select Site Settings. Just above the Site columns link we used for creating our custom Column Type is a link labeled Site content types. Click that link.

You should now be at the Site Content Type Gallery page. The same usage and warning rules apply to content types as with column types (see last week’s newsletter). Content types defined at a site level are available to that site and all subsites. It's recommended that you don't change the existing content types. At the top of this page is a Create link, which you click to begin the process of creating a new content type. You'll be prompted to enter the content type name, description, and parent content type. Let’s call this content type “Timesheet” and give it a description of “Your Company Employee timesheet”. Every content type must be based on a parent content type, the simplest being Item which contains a single text column. For our parent, choose Document Content Types/Document. Your new Timesheet content type page should look as follows.


Click the OK button to finalize the creation process. You'll be taken directly to the Site Content Type: Timesheet page, where you're given the opportunity to change various properties, such as the name and description, or add columns and so forth. For this demonstration, we're interested in the Advanced settings. Click this link to open the “Site Content Type Advanced Settings: Timesheet” page. At this point, we need to stop and create our timesheet document template.

Open Microsoft Excel and create a new template. Save the template to a location you can remember, such as My Documents. Go back to the “Site Content Type Advanced Settings: Timesheet” page and use the Browse button find and upload the new template. Leave the other settings on this page at their default values and click OK.

 

That’s all there is to it. You've just created a new content type named Timesheet and associated an Excel template with it. Now, perform the same steps for employee expenses. Your new content type will be called Expenses, and you'll need to create and associate a different Excel template with it. See the three screen shots below.

You should now have two new content types: Timesheets and Expenses. The next step is to create a new Document Library and associate these new content types with it. Go back to your sandbox site and create a new Document Library, giving it the name “Employee Timesheets and Expenses.” Go to the new Document Library settings and choose the Advanced settings link. At the top of the “Document Library Advanced Settings: Employee Timesheets and Expenses” page, you'll be prompted to allow the management of content types. Change this selection to Yes, and press OK. You've just told the Document Library to give you the ability to manage (i.e., add or remove) content types. As a result, your “Customize Employee Timesheets and Expenses” page has changed; it now contains a new section titled Content Types.

As you may have guessed, you can click the Add from existing content types link to add new content types to this Document Library. Click the link and add the Timesheet and Expenses content type.

You can now use your new "Employee Timesheets and Expenses” Document Library. The change you will notice is when you choose to create a new document. Go back to the Document Library “All Documents” view and click the down arrow next to the New link. Your users are now presented with the options of creating a default document, a Timesheet, or an Expenses document. If you choose either the Timesheet or Expenses option, note the template that is used.

You can customize many other settings for this new Document Library. For example, you can change the order in which the items (content types) are shown in the drop-down list. You can also change which item is the default or even remove or hide them. Go ahead and experiment with it and see the results of your efforts.

Content Type Inheritance

During the process of creating your new content types, you had to specify a parent content type. When you initially install Microsoft Office SharePoint Server, there are numerous content types created for you. In fact, every item in every list type is created from a defined content type, which is why it’s not a good idea to change the default content types.

If, for example, you go to your Portal’s top-level site and look at the Document content type, you will see that it is derived from the Item content type. If you look at the Item content type, you will see that it is derived from the hidden System content type. All content types defined at the top-level site are available to all sub-sites.

Defining a Content Type at a sub-site level will make it available to that sub-site and all children sub-sites.

I hope you now have a clearer understanding of what content types are and how to create new ones for your custom needs. Column type definitions are extremely powerful because they can promote standards, and reuse and reduce the necessary administration as your business needs change. The same goes for content types; you can create a base set of Corporate Content Types that you can use throughout your portal.