---
title: Creating document types
related:
  - https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/document-types/configuring-document-types/limiting-the-documents-users-can-create.md
  - https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/document-types/configuring-document-types/extending-the-document-type-listing-filter.md
  - https://docs.kentico.com/k8/developing-websites/loading-and-displaying-data-on-websites/writing-transformations/creating-transformations-for-documents.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

In this example, you will learn how to define a new custom document type.

1. Open the **Document types** application.
2. Click **New document type**. A **New document type** wizard opens.

## Step 1

1. Fill in the following values:
   - **Document type display name**: _Computer_ (the system displays this name to users in the administration interface)
   - **Namespace**: _custom_ (namespace to distinguish your document types from the default system types that use the cms namespace)
   - **Name**:_computer_ (the identifier of the document type)

     ![Filling the document type display name](https://docs.kentico.com/docsassets/k8/creating-document-types/step1_display_name.png "Filling the document type display name")
2. Click **Next**.

## Step 2

1. Enter a **Table name** for the database table that stores the document type data.
2. Enter a **Primary key name** for the table.
3. (Optional) Select if you want the document to to **Inherit fields from** **document type**.

   ![Specifying the database table name](https://docs.kentico.com/docsassets/k8/creating-document-types/step2_data_type.png "Specifying the database table name")
4. Click **Next**.

The wizard creates the database table.

## **Step 3**

Now, you need to define [fields](https://docs.kentico.com/k8/custom-development/developing-form-controls/reference-field-editor.md) of the document type (columns of the table).

1. Click **New field**.
2. For each field, enter the values, click **Save** and repeat the procedure until you have defined all the listed fields.

   - **Field name**: ComputerName
   - **Field type**: Text
   - **Field size**: 200
   - **Required:** yes (checked)
   - **Field caption**: Computer name
   - **Form control**: Text box
   - **Field name**: ComputerProcessorType
   - **Field type**: Text
   - **Field size**: 200
   - **Field caption**: Processor type
   - **Form control**: Drop-down list
   - **Editing control settings -> Data source**: select **List of options** and enter the following items into the text area, one per line:

     ```text

     Athlon;Athlon
     Pentium XEON;Pentium XEON
     Pentium Core 2 Duo;Pentium Core 2 Duo
     ```
   - **Field name**: ComputerRamSize
   - **Field type**: Integer number
   - **Field caption**: RAM (MB)
   - **Form control**: Text box
   - **Field name**: ComputerHDDSize
   - **Field type**: Integer number
   - **Field caption**: HDD (GB)
   - **Form control**: Text box
   - **Field name**: ComputerImage
   - **Field type**: File
   - **Field caption**: Image
   - **Form control**: Upload file

     ![Creating fields for the document type](https://docs.kentico.com/docsassets/k8/creating-document-types/step3_fields.png "Creating fields for the document type")
3. Click **Next**.

> **Note:** You can also define system fields that will be displayed when editing documents of this type on the **Form** tab. You can do this using the **Field type** drop-down list when creating a new field. Select **Document field** and you can then choose from the following two groups of system fields:
>
> - **Document attributes** - offers the system fields of documents.
> - **Node attributes** - offers the system fields of content tree nodes.
>
> Document or node system fields will then be offered in the **Attribute name** drop-down list. If you leave the **Display attribute in the editing form** check-box turned on, the field will be visible on the document **Form** tab.

## Step 4

Now you need to choose the field that will be used as the name for document's of this type.

1. Choose the **ComputerName** option from the drop-down list. This ensures that computer documents will use the value of the **ComputerName** field as the name displayed in site navigation and in the **Page** application's content tree. The field is available in the drop-down list because you set it as **Required** in the previous step and it's a _text_ field.

   ![Specifying document name source](https://docs.kentico.com/docsassets/k8/creating-document-types/step4_document_name_source.png "Specifying document name source")
2. Click **Next**.

## Step 5

Select the document types that will be supported as parents for computer documents in the **Page** application's content tree.

1. Click **Add document types**.
2. Select the **Page (menu item)** document type.
3. Click **OK**. Users are now only allowed to place computer documents under pages, not under articles, news items or other document types.

   ![Adding parent document types](https://docs.kentico.com/docsassets/k8/creating-document-types/step5_adding_document_types.png "Adding parent document types")
4. Click **Next**.

## Step 6

Assign the document type to all websites on which you want to use it.

1. Click **Add sites**.
2. Check the appropriate websites in the selection dialog.
3. Click **OK**.

   ![Adding sites where the document type can be used](https://docs.kentico.com/docsassets/k8/creating-document-types/step6_adding_sites.png "Adding sites where the document type can be used")
4. Click **Next**.

## Step 7

The wizard has finished the configuration of the new document type. It has automatically created not only the database table, but also the SQL queries for SELECT, INSERT, UPDATE and DELETE operations and the default transformations. 

Click **Finish**. You have created a new document type. 

> **Tip:** Now, you may want to:
>
> - [Extend the document type's listing filter](https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/document-types/configuring-document-types/extending-the-document-type-listing-filter.md) – editors use document listing to [perform multiple document (batch) operations](https://docs.kentico.com/k8/managing-website-content/working-with-documents-and-pages/multiple-document-operations.md) in the **Pages** application.
> - [Limit documents users can create](https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/document-types/configuring-document-types/limiting-the-documents-users-can-create.md) – this way you can control where on the site users create new documents.

> **Info:** **How the content is stored**
>
> The new document type _Computer_ has its own database table for its specific fields. Each document is stored in three tables: _CMS\_TREE_ (tree structure), _CMS\_Document_ (document properties, metadata and content defined on the Page tab) and the custom table - in the case of this example, _CUSTOM\_Computer._
>
> The system automatically ensures all operations are performed correctly on these tables. The advantage of this storage is that it is very fast and you can easily write standard SQL SELECT queries to retrieve data from the Microsoft SQL Server database.
