3.6. Understanding Content Types

SharePoint gives you the ability to organize and store data through the use of content types. Content types are what make it possible to store different types of content in the same list or document library. Basically, content types are a collection of settings that you can define and apply to your data. In SharePoint 2.0, when a list was created, you would define a set of columns that defined all data contained in that list. Every column was set up to track data for all items on that list, and all of the items had to fit into the schema defined by that list, and were ultimately contained by that location.

In SharePoint 3.0, the items in a list do not have to have metadata that fits into every column defined in the list. Metadata is the columns that have information that describe the information you are storing. For instance, you might store a document in a library, and the metadata would be items such as title, modified, and modified by. You can now take two different items that have different categories of information, and put them in the same list or document library. For example, if you needed to store information about houses that you are selling as a real estate agent, you might store the listing contract and offers. Each set of documents might have a different set of metadata, but they need to be stored together in the same list. This allows you to store data in a more centralized, organized manner. The different content types would each have their own defined columns that would allow them to store different information, but the content types would still coexist in the same list or document library. These different content types can also have different workflows or custom attributes assigned to them, allowing different courses of action to be taken.

3.6.1. Using File Formats for Content Types

Content types allow data to no longer be bound to a single location. This new structure allows content types to be made available across multiple sites. They are no longer defined by a list or document library, as they were in SharePoint 2.0. The content types can now be defined, stored, and managed through the site collection. Additionally, content types are not bound by file format, either. When you create a new document of a certain content type, SharePoint will automatically create the document using the template that has been set up. However, you have the ability to upload a file to the document library, defined as the same content type, and the type of file does not matter. Content types can also be assigned to list items and folders, which have no file format.

NOTE

Content types made for lists can only be used for lists, and ones made for document libraries can only be used for document libraries. However, content types made for folders can be used for either.

Look at this example. A real estate agent may have many listings to manage. She also gets offers on those listings—some that are acceptable, and some that are not. The agent may want to store listing documents and offer documents in the same document library, but the columns defined for each are going to be different. In this example, two content types could be defined—call them Listings and Offers. The Listings content type will define columns that are associated with a listing, such as: listing date, listing price, seller name, and seller phone number. However, the Offer content type would have a different set of defined columns, such as: offer date, offer price, closing date. Each of these content types has different metadata, but they can both be stored in a central document library.

You can view the entire list of site content types by following these steps:

  1. Navigate to the site collections main page.

  2. From a publishing page, click Site Actions, then Site Settings, and then Modify Site Settings, or from a standard page select Site Actions, then Site Settings.

  3. Under the Galleries section, select Site content types, which lists all of the content types in the site collection.

3.6.2. Creating Content Types

Many times companies will have their own definition of what describes data. In that case, you will want to create your own content types that can be part of the site collection. To create your own content type, use the following steps:

  1. Click on the Site Settings page

  2. Then under Galleries, click on the link that takes you to Site content types. Here, you will find all of the content types that you can use on the current site and its subsites.

  3. Click on the button available at the top left labeled Create to create a new content type.

  4. Enter a meaningful name and description, then select the parent type of List Content Types and the parent content type Item.

  5. Keep the group as Custom Content Type, and press OK.

The content type of Item is the most basic type of content type. The Item content type only contains a field called Title. When a new content type is being created, the default settings are copied from the parent content type. Also, when the parent content type is changed in the future, the changes can also be pushed down to the child content types. This makes inheriting and changing a content type much easier than having to change every item that has used the content type. Being able to inherit types allows for a much more meaningful use of data and enables you to easily build more complex sets of data.

On the New Site Content Type page, specify the name and description of the new content type. In the example shown in Figure 3-7, the name of the new content type is Offers Made. Next, select a parent content type from the drop-down list, and then select the actual parent content type. Again, remember that a content type created for lists can only be used for lists, and one made for a document library can only be used for a document library, but a content type made for a folder can be used for either. In the example, the parent content type is set to Document Content Types and the Parent Content Type chosen is Document. Next, choose a new or existing group to put the content type into, and then click OK. Because a new content type is being created, Custom Content Types was chosen for the group.

Figure 3.7. Figure 3-7

3.6.3. Assigning Settings to Content Types

Content types have many attributes that need to be set when they are created. When the new content type is created, SharePoint brings up the Site Content Type page for that new content type. It is here that you can assign all of the settings to your new content type. A content type can include information such as properties, workflows, document templates, custom forms, and custom information that is stored in XML.

Under the first heading, Settings, there is a link to change the name, description, and group. Since all of these settings were just set when the content type was created, they are okay for now. The next link is for advanced settings. Because this content type is a document content type, this link allows for the assigning of a document template. Whenever a new document is created using the Offers Made content type, SharePoint automatically uses this assigned document template.

The advanced setting page is also where the content type can be set to read-only. If the content type is not read-only, it can be modified later by users through the user interface in SharePoint. Below the Read Only option is the Update Sites and Lists section that sets inheritance for the updates of the content type to all of the child sites and list content types that inherit from it. Back at the Site Content Type page, the link Workflow settings is used to view or make changes to the workflow settings for the new content type. The link Delete this site content type is used to delete the new site content type.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.103.229