SharePoint: Content Type Tutorial
Introduction
A content type is an entity that uses site columns to define a schema of fields for an item in a list or a document in a document library. The content types are defined outside the scope of any list or document library. A content type defines a field collection that is reusable across multiple lists or multiple document libraries. You can update a content type to make the changes available in all list and libraries.
References
You can also read: Working with Content Type Hub in SharePoint 2013
Content Type
A content type represents a group of informational items in your organization that share common properties. Properties may be like name, description, a grouping category etc.
SharePoint supports storing multiple content types in one document library. But only one content type can be applied to a particular item in a document library or list. It will be same for both on-premise and online.
Each content type has a distinctive set of properties and metadata that describe the content. This can include fields that are associated with the content type that can be displayed as columns in the list or document library. It can also include a specific document template used when creating instances of the content type.
You can access the content type from the url directly http://mypc/sites/MySP2016SiteCollection/_layouts/15/start.aspx#/_layouts/15/mngctype.aspx
Or we can access it from Site Settings page -> then click on Site content types which is under Web Designer Galleries.
Here you can see all the site content types like below:
https://www.enjoysharepoint.com/wp-content/uploads/2018/07/content-types-sharepoint-2013-1.png
You can also filter based one the content type group. Like you can filter list content types like below:
https://www.enjoysharepoint.com/wp-content/uploads/2018/07/content-types-sharepoint-2016.png
When you add a content type to the content types gallery of a specific site, that content type is available for use within the current site, as well as in all the child sites in the site hierarchy below it. When you add a content type to the content types gallery of a top-level site, it is available for use throughout the entire site collection.
Standard set
SharePoint automatically adds a standard set of content types to the content types gallery of every top-level site.
Few shown are:
ID |
Name |
Parent |
0x01 |
Item |
System |
0x0101 |
Document |
Item |
0x0102 |
Event |
Item |
0x0104 |
Announcement |
Item |
0x0105 |
Link |
Item |
0x0106 |
Contact |
Item |
0x0108 |
Task |
Item |
0x0120 |
Folder |
Item |
0x010101 |
Form |
Document |
0x010102 |
Picture |
Document |
0x010105 |
Master Page |
Document |
0x010108 |
Wiki Page |
Document |
0x010109 |
Basic Page |
Document |
0x012002 |
Discussion |
Folder |
0x012004 |
Summary Task |
Folder |
Steps to Create a Content Type:
Every content type that you can create or use inherits from another content type. SharePoint provides a special hidden content type named System, which exists at the very top of the inheritance hierarchy above Item. But as a developer we never interact directly with System content type, so Item content type considered as parent content type of other content types in SharePoint.
Each content type has a string-based ID that begins with the ID of its parent content type. Let us say u create a content type based in Item content type then the content type ID will begins with 0x01. The Document content type, which inherits from Item, has an ID of 0x0101. Content types that inherit from Document have IDs that begin with 0x0101 such as Form which has an ID of 0x010101.
When you will create a new content type, then content type id will be in below format.
Base Content Type ID +00+a new GUID.
Like a new content type which inherits from parent will be like below: 0x010100F51AEB6BBC8EA2469E1617071D9FF658
To create a content type follow below steps:
Open SharePoint 2016 Site using browser. Then click on the gear icon and then click on Site Settings. In the Site Settings page click on "Site content types" link which is under "Web Designer Galleries". This will open the Site Content Types pages. There click on the Create button as shown in the fig below:
https://www.enjoysharepoint.com/wp-content/uploads/2018/07/content-types-sharepoint-online.png
Then give a name and description for the content type. Then choose a parent content type. Here we have chosen List Content Type and then choose Parent Content Type as Item.
Then select a group for the content type. Either you can create a new group or you can add to an existing group as shown in the fig below:
https://www.enjoysharepoint.com/wp-content/uploads/2018/07/sharepoint-2013-content-type.png
Your site content type will be created successfully and will be looks like below:
This is the content type settings page. You can add existing site columns or you can create new columns also.
https://www.enjoysharepoint.com/wp-content/uploads/2018/07/sharepoint-2013-content-type-tutorial.png
Click on Add from site column to create a new site column for our content type.
Here I have added a site column of type choice which has below 3 values:
- SharePoint Development
- SharePoint Administration
- SharePoint End User
Then we can add one of the existing site column. Then click on
Then select Mobile Number column from the Available Column and click on OK as shown in the fig below:
https://www.enjoysharepoint.com/wp-content/uploads/2018/07/sharepoint-2016-content-type-tutorial.png
The content type will now have three columns
- - Title
- - Training Type (Site Column)
- - Mobile Number (Site Column)
Since we have made the content type we can add it to our list.
Open the SharePoint 2016 list in the browser. Then from LIST tab click List Settings. Then in the list settings page click on Advanced Settings which is under General Settings.
Then in the Content Types select Yes for "Allow management of content types?" and then click on OK:
https://www.enjoysharepoint.com/wp-content/uploads/2018/07/what-is-content-type-sharepoint-2013.png
Then go back to the List Settings page, then go to the Content Types section, click on Add from existing site content types.
Then in the Add Content Types page, from the content types group, select Custom Content Types from the drop down. And then select InPerson Training Enquiry and click on OK:
https://www.enjoysharepoint.com/wp-content/uploads/2018/07/what-is-content-type-sharepoint-2016.png
The content type added successfully.
Now open your list and go to ITEMS tab and then click on New Item, you can see the new content type as shown in the fig below:
If you will open the InPerson Training Enquiry you will see the columns which we have added to the content type like below: