Content Type Hub Creation
In this article we can explore how to create Content Type creation.
What is Content Type Hub?
We can use a Content Type Hub to share the content types across multiple web applications.
For example, you created an Expense Content Type and wanted to share with multiple web applications. Content Type Hub is a web application that allows sharing of content types. The centralized content type rendering reduces the effort in updating changes.
For example, if the expense content type template is changed, then you need to update it in only one place.
Step 1: Create Content Type Hub web application
Go to SharePoint Central Administration and create a new web application. Call it as Content Type Hub.
Open Central Administration then the select "Manage web applications" link.
In the page that appears, choose the "New" button. In the page that appears, enter the details as shown below.
Click the "OK" button to create the web application.
Wait for a few minutes and you will be ready with the web application.
Click the Create Site Collection link to create a site collection inside our new content type web application.
After creation, navigate to the newly created content type hub web application.
Now we are ready with our content type web application and site collection.
Step 2: Configure Managed Metadata Service
In this step, we need to configure the Managed Metadata Service to use our newly created content type hub URL. This makes the subscriber sites to use our published content types.
Open Central Administration then select the "Manage Service applications" link.
In the page that appears, locate the Managed Metadata Service row and click on the Properties button from the toolbar.
In the page that appears, go to the bottom and enter the content type hub URL as shown below.
Now you have set the Content Type Hub. Click the "OK" button to save the changes.
As the next step, click on the second row in service applications and click "Properties".
In the page that appears, check the option "Consumes content types" from the Content Type Gallary at the URL.
Click the "Ok" button to save the changes. Now you are ready with the content type infrastructure.
Step 3: Create Template
We are planning to create an Expense Content Type along with a Template.
Create an Excel file and format the cells with the following fields.
Now save the file as an Excel template.
Step 4: Create Content Type
Now open the content type hub web application and go to "Site actions" > "Site settings" > "Site content types" > "Create content type".
Enter the name as "Expense Content Type" and select "Document" from the category.
Click the "Ok" button to continue. In the page that appears, choose "Advanced Settings".
We will edit the template URL now. In the page that appears choose our Excel Template file.
Click "OK" to save the changes.
Now from the Expense content type page choose the "Manage publishing for this content type" link.
In the page that appears, choose the "Publish" option.
Click the "OK" button to continue.
Now the content type will be pushed for publishing.
Step 5: Run Timer Jobs
The actual publishing is done through 2 timer jobs:
- Publishing Timer Job
- Subscriber Timer Job for each Web Application
We need to run those timer jobs.
Open Central Administration then select "Monitoring" > "Review Job Definitions" > "Locate the Timer Jobs" then choose the "Run Now" option.
You can verify that the jobs have completed by using the "Running Jobs" link.
If the page is clear then it means the jobs have completed. You have successfully published the Content Types through Content Types Hub.
Step 6: Test the Content Type
Now we are ready to test the published content types. Please note that we have the following:
- Content Type Hub web application
- Consumer web application (default SharePoint site)
Open your default SharePoint site and go to "Site actions" > "Site settings" > "Site content types" page. You should see the Expense Content Type there.
Create a new document library. Go to "Library Settings" > "Advanced Settings" then enable "Allow Management of Content Types".
Return to the Library Settings Page and delete the existing content type there. To delete it, click the "Document" content type and choose "Delete".
Now choose the "Add from existing site content types" option.
In the page that appears choose the "Custom Content Types" option and select the "Expense Content Type" and click the "Add" button.
Click the "OK" button to save changes.
Back in the library, choose the New button and you will be getting the new document created from the Expense Content Type template as shown below.
Click "Save changes" and you will get the xlsx file saved in the document library.
This concludes the usage of content type template.
For changing the template, you can go the content type hub, edit expense content type, upload the new template (change color) and choose the publish procedure.
After publishing is over, you can try creating a new document and the new template should reflect the changes.
In this way we can have centralized control over content type and template.
- Under the hood Content Type Publishing is done through Managed Metadata Service.
- It is advisable to use a separate content database for the site collection hosting content type.
- Custom Group for content types and Inherited ones are easier to maintain and republish
In this article we have explored how to create a content type hub.