共用方式為


Adding Columns in Content Types to Lists

Applies to: SharePoint Foundation 2010

When you add a content type to a list, the columns referenced in that content type are added to the list as list columns, if they are not already in the list.

The following figure shows columns being added to a list through the addition of content types. In the figure, a site content type—Specification—has three site columns that are referenced. The site content type contains a reference to the site column definition for each added column: Developer, Milestone, and Status. The site column collection contains definitions for all site columns that are available on this site.

When you add the content type to a list, SharePoint Foundation copies the site content type locally as a list content type, and copies the column templates locally to the list as list columns. The list content type contains references to the list columns that are copied to the list, rather than the site columns in the site column collection at the site level. As a result, you can make local changes to a column as it appears on that list, and those changes do not affect the site column itself or list columns on other lists that inherit from that site column.

Site columns associated with a list content type

In the following figure, we show a more complex case, in which multiple site content types are added to the same list. Two site content types, Memo and Spec, are created at the site collection root site. Because of their location, these site content types are available for all other sites in the site collection to inherit. A list administrator adds both site content types to the specific list shown in the figure. At this point, SharePoint Foundation copies the site content types locally to the list as list content types. SharePoint Foundation examines the two list content types to determine which, if any, columns to add to the list. In this example, Memo references two columns, Author and Subject, while the Spec content type references three: Author, Test, and Developer. SharePoint Foundation adds the required columns.

Although Author is referenced in both content types, it is only added one time to the list. In addition, if Author is a required column for the Spec content type, but not for the Memo content type, on the list it is required only for items of the Spec content type.

Columns added to a list for content types

Adding Columns on a List to Content Types

When you add columns directly to a list, and that list contains multiple content types, you can specify whether you want the new column to be referenced in all the content types on that list. If you do reference the column in the list content types, and you set the column as required for the list, the column is set as required within each list content type as well. However, you can later override the required setting in the specific list content types.

You can also add existing list columns to the list content types on the list.

See Also

Concepts

Introduction to Columns

Updating Site Columns

Introduction to Content Types