---
title: Creating content only page types
---

> 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).

> **Info:** This page is a part of a tutorial, which you should follow sequentially, from the beginning to the end. [Go to the first page: Getting started with Kentico](https://docs.kentico.com/k11tutorial/getting-started-with-kentico.md).

## You will learn about:

In [step 1](https://docs.kentico.com/k11tutorial/mvc-development/creating-a-new-mvc-site.md) and [step 2](https://docs.kentico.com/k11tutorial/mvc-development/creating-a-new-mvc-application.md) of this tutorial, you have set up your environment for MVC development. Let's start building your tutorial website. 

The website will have two pages and a simple navigation menu. The _Home_ page will have a _header_, a _text heading,_ and the _text_ itself. The _Medical center_ page will have a _header_ text field and a content field that can be formatted using HTML. To allow content editors full control over the menu, you will create a menu item page type with a page selector and another page type representing a content tree section that will separate the menu items from the rest of the pages. The menu item page type will allow editors to hand-pick pages that will display in the website's navigation.

In this tutorial step, you will create page types for the dynamic menu and the pages that will store the content of the MVC site.

## Content only page types in Kentico MVC

**Content only page types** are the most suitable page type for the development of an MVC site. They use fields to define a reusable structure of the page, and content editors use these fields to edit content on their website. Each page type has a separate database table storing the values of the defined fields, and also uses two general tables to store additional page information.

**Content only pages** are not based on traditional page templates. Their content, e.g., text, HTML hyperlinks, images, etc., is stored and edited via the Kentico administration interface, but the presentation of the content is handled by corresponding MVC views. To help your website editors navigate around their content, you can create a hierarchical structure on the Kentico site. This structure will be just a visual representation, because content only pages do not define actual pages on the live site.

### How is the data stored?

For example, your _Home_ page type for the tutorial website will have three fields. The first two _Tex&#x74;_&#x66;ields will hold the page header and the heading, and the third field will be a _Text area_. Any page based on this new page type will have its content stored in the _MEDIO\_Home_ database table. Additional data, such as general page properties, is stored in the _CMS\_Document_ table, and data related to the page's position in the content tree hierarchy is stored in the _CMS\_Tree_ table.

## Creating the page type for the Home page

1. In the **Page types** application, click the **New page type** button to start the wizard.

   ![Create a new content only page type](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/create_new_mvc_page_type.png "Create a new content only page type")
2. In **Step 1** of the wizard, fill in the following values:
   - **Page type display name**: Home(MEDIO Clinic)
   - **Namespace**: MEDIO
   - **Name**: Home

     ![Creating a new content only page type basic properties](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/new_mvc_page_type_wizard_1.png "Creating a new content only page type basic properties")
3. Click **Next**.
4. In **Step 2**, make sure the **Content only page type** option is selected, and leave the other values as they are.

   ![New mvc page type wizard 2](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/new_mvc_page_type_wizard_2.png)
5. Click **Next**.
6. In **Step 3**, click the **New field** button to create a field for the _page header_.
7. Fill in the following values:
   - **Field name**: HomeHeader
   - **Data** **type**: Text
   - **Size**: 1000
   - **Field\*\*\*\*caption**: Header
   - **Form control**: Text area

     ![Setting up new text field properties in a content only page type](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/new_mvc_page_type_wizard_3_2.png "Setting up new text field properties in a content only page type")
8. Click **Save**.
9. Click the **New field** button to create the second field for the _page heading_ with the following values:

   - **Field name**: HomeTextHeading
   - **Data type**: Text
   - **Size**: 200
   - **Field caption**: Text heading
   - **Form control**: Text box

     ![Creating a new field to hold long text](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/new_mvc_page_type_wizard_3_3.png "Creating a new field to hold long text")
10. Click **Save**.
11. Create the third field for the page text with the following values:
    - **Field name**: HomeText
    - **Data type**: Long text
    - **Field caption**: Text
    - **Form control**: Text area

      ![Creating the long text data type on the Home page](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/new_mvc_page_type_wizard_3_4.png "Creating the long text data type on the Home page")
12. Click **Save**.
13. Click **Next**.
14. In **Step 4**, do not change anything, and click **Next**.
15. In **Step 5**, click **Next**.
16. In **Step 6**, click **Next**.
17. In **Step 7**, click **Finish** to complete the new page type wizard.

    ![New mvc page type wizard 5](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/new_mvc_page_type_wizard_5.png)

### Setting the page type's URL pattern

Content only pages just store data, and the presentation of actual web pages is handled by the MVC application. As a result, the Kentico administration application does not automatically know the live URLs under which individual pages will be available.

You can add this information into the system by setting a **URL pattern** for your content only page types.

> **Info:** **Features that use the URL pattern**
>
> By setting the correct URL pattern for your page types, you allow content editors to do the following:
>
> - Preview content in the _Pages_ application, and use the _Live site_ button in the application list to open the appropriate page on the MVC site
> - Add page links into the content of rich text fields using the system's WYSIWYG editor
>
> Additionally, the sample implementation of the navigation menu in this tutorial will use the URL pattern values to generate page links.

1. In the **Page types** application, make sure you are on the **General** tab of your _Home (MEDIO clinic)_ page type.
2. Type the following value into the **URL pattern** field: _/Home_

   ![Setting the page types URL pattern](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/setting_the_url_pattern_field.png "Setting the page types URL pattern")
3. Click **Save**.

There will only be a single Home page of the _Home (MEDIO clinic)_ type, so a static _/Home_ URL pattern is sufficient. On more complex sites, you may need to add macro variables into the pattern to generate URLs dynamically (e.g. for identifiers when using the same page type for multiple pages, or for different language versions of the same page). The system combines the URL pattern with the site's presentation URL, so the final live URL of the Home page will be: _http://localhost/MedioMVC/Home_

### Preparing the page type's wrapper classes

Before you start adding new pages and their content, let's make sure you'll be able to work with this page type in your MVC application. Kentico allows you to generate code for your page type directly from the user interface.

1. To generate code for the _Home (MEDIO Clinic)_ page type, switch to the **Code** tab.
2. Verify the **Save path** (by default, the path is set to _\~/App\_Code/CMSClasses_), and click **Save code**.

   > **Note:** If you have installed Kentico as a web application, your default path to save classes will be set to _\~/Old\_App\_Code/CMSClasses_.

   ![Generating code for the page type on your website](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/new_mvc_site_generating_code.png "Generating code for the page type on your website")

The code generator creates two wrapper classes, _Home_ and _HomeProvider._ The Home class contains properties matching the page type fields you have defined, and the provider allows developers to work with pages of the given type in the MVC site's code.

Later in the tutorial, you will use these two classes to retrieve and display content on the website. But first, let's create all page types you will need to build your tutorial website.

## Creating the page type for the Medical center page

1. In the **Page types** application, click the **New page type** button to start the wizard.
2. In **Step\*\*\*\*1** of the wizard, fill in the following values:
   1. **Page type display name**:Medical center (MEDIO Clinic)
   2. **Namespace**: MEDIO
   3. **Name**: MedicalCenter
3. In **Step 2**, make sure the **Content only page type** option is selected.
4. In **Step 3**, create two fields with following values:
   1. The field for the _Medical center_ header
      - **Field name**: MedicalCenterHeader
      - **Data type**: Text
      - **Size**: 200
      - **Field caption**: Header
   2. The field for the _Medical center_ text
      - **Field name**: MedicalCenterText
      - **Data type**: Long text
      - **Field caption**: Text
      - **Form control**: Rich text editor
5. Finish the page type wizard.
6. On the **General** tab of the _Medical center (MEDIO Clinic)_ page type, enter _/MedicalCenter_ into the **URL pattern** field.
7. Click **Save**.
8. Switch to the **Code** tab.
9. Verify that the **Save path** is set to _\~/App\_Code/CMSClasses_ and save the code of the page type.

You have created the page types for your pages. Now, let's create the page types you will use to build the navigation menu.

## Creating the page types for the website navigation

There are several ways to implement navigation on MVC sites. This tutorial demonstrates how to create a dynamic navigation menu that allows content editors to control the content. Your website's editors will create new menu items as separate "pages" in the content tree, and select which page from the content tree will be the link target for each menu item. You will then code the menu's appearance and linking functionality in the MVC application. This dynamic approach gives editors full control over the navigation menu items, without the need to adjust the MVC site's code.

### Creating the page type for the menu section

To keep the content tree organized, you will first create a page type that will serve as a parent for the menu items and separate them from the remaining pages.

1. In the **Page types** application, click the **New page type** button.
2. In **Step 1** of the wizard, fill in the following values:
   - **Page type display name**:Menu items (MEDIO Clinic)
   - **Namespace**: MEDIO
   - **Name**: MenuItems
3. In **Step\*\*\*\*2**, make sure the **Content only page type** option is selected.
4. In **Step 3**, create a new required field with the following values:
   - **Field name**: MenuItems
   - **Data type**: Text
   - **Size**: 200
   - **Required**: Yes (selected)
   - **Field caption**: Name
5. In **Step 4**, leave the _MenuItems_ field as the **Page name source** and click **Next**.
6. Finish the wizard.
7. On the **General** tab, type _**/**_ (_forward slash_) into the **URL pattern** field. This ensures that the preview and live URL for the menu items page in the _Pages_ application always displays the site's root page.
8. Click **Save**.

This page type will be used to create a content tree section for menu items, so they don't visually blend in with the rest of the pages. The resulting page will only serve as a visual separator, and you will not work with it in the MVC application.

### Creating the page type for menu items

For the individual items in the menu, you need a _text_ caption which will be displayed on the live site, and a way to choose where the hyperlink will send visitors. For the latter, you will use a _page selector_ which allows editors to hand-pick the items in the content tree. While building this page type, you will also limit the scope so content editors can only add menu items as child pages under the _Menu items_ section.

1. In the **Page types** application, click the **New page type** button.
2. In **Step 1** of the wizard, fill in the following values:
   - **Page type display name**:Menu item (MEDIO Clinic)
   - **Namespace**: MEDIO
   - **Name**: MenuItem
3. In **Step 2**, make sure the **Content-only page type** option is selected.
4. In **Step 3**, create fields with the following values:
   1. The field for the menu item text:
      - **Field name**: MenuItemText
      - **Data type**: Text
      - **Size**: 200
      - **Required:** Yes
      - **Field caption**: Menu text

        ![Creating a name text field for the menu item page](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/creating_the_menu_item_page_type_menu_text.png "Creating a name text field for the menu item page")
   2. The field for the page selector:
      - **Field name**: MenuItemPage
      - **Data type**: Unique identifier (GUID)
      - **Required:** Yes
      - **Field caption**: Page
      - **Form\*\*\*\*control**: Page selector

        ![Creating a new page selector field](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/creating_the_menu_item_page_type_page_selector.png "Creating a new page selector field")
5. In **Step 5**, update the **Allowed parent page types**:

   - Remove **Root (CMS.Root)** as an allowed parent page type – select _R\*\*oot_ _(CMS.Root)_ in the list, click the **Remove selected** button, then click **OK**.
   - Click the **Add page types** button and select the **Menu items (MEDIO.MenuItems)** page type as the allowed parent.

     ![Setting up allowed parent page type for menu item](https://docs.kentico.com/docsassets/k11tutorial/creating-content-only-page-types/creating_the_menu_item_page_type_allowed_parent_page_type.png "Setting up allowed parent page type for menu item")
6. Finish the wizard.
7. On the **General** tab, type _**/**_ (_forward slash_) into the **URL pattern** field. This ensures that the preview and live URL for menu items in the _Pages_ application always displays the site's root page.
8. Click **Save**.
9. Switch to the **Code** tab and save the code for your _Menu item (MEDIO Clinic)_ page type.

You have now prepared all the page types you need for your tutorial website. Let's add some content to your _MEDIO Clinic MVC_ site.

**Previous page:** [Creating a new MVC application](https://docs.kentico.com/k11tutorial/mvc-development/creating-a-new-mvc-application.md) — **Next page:** [Adding content only pages to the MVC site](https://docs.kentico.com/k11tutorial/mvc-development/adding-content-only-pages-to-the-mvc-site.md)

**Completed pages:** 4 of 10

ΟΟΟ**Ο**ΟΟΟOΟΟΟ
