Document Types
Last updated
Last updated
The first step in creating an Umbraco site is to set up a Document Type. A Document Type acts as a data container in Umbraco, where you can add Properties (data fields or attributes) to store content. Each Property is assigned a Data Type, such as a text string, number, or rich text editor. Umbraco uses Templates to render this input data on the front end.
Here are some of the most common properties you might add in a Document Type:
Page Title
Sub Heading
Body Text
Meta Title
Meta Description
To create a Document Type:
Go to Settings.
Click ... next to the Document Types.
Select Create...
Select Document Type with Template.
Folders can help you organize your Document Types.
Enter a Name for the Document Type. Let's call it HomePage. You'll notice that an Alias is automatically created.
The alias of the Document Type is automatically generated based on the property name. If you want to change the auto-generated alias, click the "lock" icon. The alias must be in camelcase. For example homePage.
Click Save. Our new Document Type is now visible as a new item under Document Types.
With the help of icons, you can identify different Document Types in the Content Tree. To add an icon:
Click the icon placeholder next to the document name. The Select Icon dialog opens.
Browse through the icon list and select the icon of your choice.
Click Submit.
Click Save.
To create a Document Type at the root of the Content Tree:
Go to the Structure tab.
Toggle the Allow at root button.
If Allow at root is not enabled on the Document Type, you cannot create any content on your site.
Click Save.
To add properties to your Document Type, follow these steps:
Go to the Design tab.
Click Add Group.
Enter a Name for the group. For this tutorial, we will call it Content.
Click Add property. The Add property dialog opens.
Enter a Name. For example: Page Title.
Enter a Description. For example: The main title of the page (Welcome to Widgets Ltd.).
Click Select Property Editor.
Select the Data Type of your choice. We'll add text in the search box and select the Textstring Data Type.
Click Submit.
Remember to come back and explore the list of Data Types later.
Repeat Steps 4 to 9 to add a Body Text using the specification below:
Name | Body Text |
---|---|
Description | The main content of the page. |
Data Type | Richtext Editor |
Click Add Group to create a new group called Footer. Repeat Steps 4 to 9 to add a Footer Text using the specification below:
Name | Footer Text |
---|---|
Description | Copyright notice for the footer. |
Data Type | Textstring |
Your Document Type should now look like this:
Click Save.
We’ve now created our first Document Type. Umbraco takes the data from an instance of the Document Type (also called Content Node). This data is then merged with a Template – let's create our template next.