Day-to-day example (to understand SharePoint content types)
The example that we are going to discuss is the Banking system. When we need to make some transactions like cash withdrawal, cash deposit, cheque encashment, etc. we use different formats of slips. Making use of different format slips for different purposes makes it easy for bank officers to differentiate the type of transaction.
Consider that the bank has one big box in which they keep all kind of slips together. By the end of the day, it will be easier for them to differentiate the different formats of slips and make the calculations. If they would have used the same slip format for all kind of transactions (deposit, withdrawal, etc) it would have become difficult for them to deal with them. It may cause the huge loss for the bank as well.
In this example, you can consider
- Big box (in which the slips are collected) as your list or library
- Different formats of slips as SharePoint Content Type
- Unique fields (like Name, Account number, Signature) in all formats of slips as Site columns
Thus, a content type is a reusable group of site columns which represents a set of information.
You can find another awesome example given by Greg here: Content Types Example
SharePoint Content Types
You will hear the word Content type every day while working with SharePoint. It is very important to understand and utilize the same. According to Microsoft, A content type is a reusable collection of metadata (columns), workflow, behavior, and other settings for a category of items or documents in a SharePoint list or document library. Content types enable you to manage the settings for a category of information in a centralized, reusable way.
SharePoint content type provides one more advantage to you, whenever you make any changes in content type, it provides an option whether to apply the new changes to all the lists (which are using that particular content type) or not.
If you have worked on a Task list or Announcement list then you have already used a content type. SharePoint has many default content types. If you create a new Task list, you can see that there are some columns already available like Task name, start date, due date, etc. These columns are default site columns and the Task list is using default content type as Task as shown below.
How to create a SharePoint content type?
Before creating a Content type you should make note of below important points
- It’s a best practice to create a Content type under the root site (top site) so that it can be used under all subsites as well. This is again based on the requirements of the organization because users don’t want to have too many content types under the root sites, which are not useful.
- If you create a Content type in a subsite, you cant use that Content type in your root site.
- When you update the Content type, it’s your wish whether to apply the updates on existing lists or not.
- If you want to delete the content type from the site collection, you need to remove that content type from all the associated list/libraries.
A) Create a content type for List
- Create a list named BankingSystem
- We will create 2 content types named Cash Deposit and Cash Withdrawal
- Create 3 site columns named Customer Name, Account Number, Signature (You can read this article on creating site columns: SharePoint Site Columns)
- Go to Site Settings> Web Designer Galleries > Site content types
- Click on create
- Enter the information as shown below. It will ask you to choose a Parent Content type, you can choose anyone. In this case, I have chosen Item content type. Item content type by default has Title site column only. Finally, click on OK
- Now our content type is ready but before using it we have to first add site columns to it.
- To add site columns to this content type, go to Site Settings > Web Designer Galleries > Site content types > Click on newly created a content type (Cash Deposit)
- Click on Add from existing site columns
- Add the site columns to this content type. Here is an important point need to be noted. Add all the required site columns for this content type. In the below screenshot I have added only 3 but you can add as many as you want to make it different from other content types.
- Similarly, add another content type and name it Cash Withdrawal with some different site columns.
- Now both the content types are ready for use. Let's add these content types to a List named BankingSystem
- Go to List Settings > Advanced settings > make sure the Allow management of content type is selected as shown below:
- Click on Add from existing site content types
- Add both the custom content types as shown below
- You can see both these content types are available under the New Item option
B) Create a SharePoint Content Type for Document Library
- Create a Document Library named BankingSystem
- We will create 2 content types named Cash Deposit and Cash Withdrawal
- Create 3 site columns named Customer Name, Account Number, Signature (You can read this article on creating site columns: SharePoint Site Columns)
- Go to Site Settings > Web Designer Galleries > Site content types
- Then click on create.
- Enter the information as shown below. It will ask you to choose a Parent Content type, you can choose anything. In this case, I have chosen Document content type. Finally, click on OK
- Now our content type is ready but before using it we can add site columns to it or can change the document template from advanced settings as shown below
- To add site columns to this content type, go to Site Settings > Web Designer Galleries > Site content types > Click on newly created a content type (Cash Deposit)
- Click on Add from existing site columns
- Add the site columns to this content type. Here is an important point need to be noted. Add all the required site columns for this content type. In the below screenshot I have added only 3 but you can add as many as you want to make it different from other content types.
- Similarly, add another content type and name it Cash Withdrawal with some different site columns.
- Now both the content types are ready for use. Let's add these content types to a Library named BankingSystem
- Go to Library Settings > Advanced settings > make sure the Allow management of content type is selected as shown below:
- Click on Add from existing site content types
- Add both the custom content types as shown below
- You can see both these content types are available under the New Document option
0 Comments