Creating page types

This page describes how to create page types in the Page types application.

Creating page types

  1. Open the Page types application.
  2. Click New page type.

The New page type wizard opens. Your choices throughout the wizard determine the functionality and purpose of the given pages. The resulting pages may represent actual pages available on the live site, only serve as data containers used by other pages, or simply provide folders for organizing and categorizing the website content tree.

Step 1 – Names

  1. Fill in the following values:
    • Page type display name – the system displays this name to users in the administration interface

    • Namespace – the namespace is a prefix that distinguishes between page types. For example, it can be used to separate page types created for different sites, identify page types imported as part of third-party modules, etc.

    • Name – a unique page type identifier, which is appended to the namespace.

      Important

      When creating page types, always use a unique namespace.

      Never use the cms, com, om or content prefixes. A recommended option is to use your company name or an abbreviation as the prefix, for example: ACME_MyPageType.

  2. Click Next.

Filling in the page type names

Step 2 – Features

Select the features that you want to enable for the page type, depending on the intended purpose of the given pages:

  • Page builder – allows editors to manage page content through a user-friendly interface. This page type feature is required to work with configurable widgets, and adjust the layout of pages by selecting page templates. The page builder feature must also be enabled in the code of the live site application (see Page builder development). Enabling this feature also enables the URL feature – it is not possible to edit page builder pages without the page being accessible in some form.
  • URL – allows pages to have URLs configurable depending on the selected routing mode. This feature also controls the visibility of the Alternative URLs editing interface, if enabled for the site.
  • Metadata – allows editors to enter metadata for pages. Metadata present details about the content of your pages, which can be used directly as part of your website (e.g. title) or when implementing search engine optimizations. The metadata include page title, description, and keywords. For more information, see Editing metadata of pages and Displaying page content.
  • Navigation item – allows content editors to control which pages appear in the website’s navigation menus. For more information, see Building website navigation.

All pages based on this page type will have the selected features.

Note: some features may not be available for editing if pages of the particular page type were already created in the content tree.

Click Next.

Selecting features for a new page type

Step 3 – Database information

  1. Choose whether the page type will contain custom fields and have a dedicated database table.

    The remainder of this page describes page types with custom fields.

    To create a page type without custom fields, click the Skip this step and continue without custom fields link in the wizard footer. To learn more about such page types, switch to the Creating page types without fields page.

  2. Enter a Table name for the database table that stores the data of the page type’s fields.

  3. Enter a Primary key name for the table.

  4. (Optional) Select if you want the page to Inherit fields from page type (reuse the field structure of an existing page type).

  5. Click Next.

The system creates the database table.

Filling in the database information for a page type

Step 4 – Fields

Now, you need to define the page type’s data fields (columns of the table):

  1. Click New field.

  2. Define the custom field using the field editor.

    • You can use the field editor to create new page type fields, or to group the fields into categories.
  3. Click Save.

  4. Repeat the steps above for all required fields.

  5. Click Next after you have prepared all necessary fields for the page type.

You can also make system page fields editable on the Content tab of the Pages application for pages of the given type. To do this, create a new field and select Page field in the Field type drop-down list. You can then choose from the following two groups of system fields:

  • Page fields – general page fields that have separate values for each language version of the page.
  • Node fields – general page fields that are shared by the entire content tree node (all language versions of the page).

Page or node system fields are then offered in the Field name drop-down list.

Creating fields for the page type

Step 5 – Parent types

Select the parent page types under which pages of the new type will be allowed in the website content tree (when managing pages in the Pages application).

  1. Click Add page types and select specific page types.
  2. Click OK.
  3. Click Next.

Adding parent page types

Step 6

The wizard has finished the configuration of the new page type.

Click Finish. You have created a new page type. 

How content in page types is stored

The new page type has its own database table for its specific fields. The overall data of pages is stored in three tables:

  • CMS_Tree (content tree structure)
  • CMS_Document (general page properties, metadata and page builder content defined on the Page tab)
  • The dedicated page type table, e.g. custom_Article (the page type fields)

For detailed information, see: Page database structure

Step 7 - Generating page type wrapper classes

To simplify working with the page type when developing your website, generate and include wrapper classes for your page type into your live site project.

Since each page type can contain a different set of custom fields, the system cannot provide strongly-typed access to individual fields via a shared general class. For this reason, accessing custom fields can be unwieldy, often needing additional code to be written. The process requires developers to:

  • specify database column names to manipulate data from particular fields, and
  • manually perform value type conversion and validation on the data as it gets retrieved from and stored to the database.

To alleviate this issue, the system allows you to generate page type-specific classes. The class inherits from the TreeNode base class (representing page objects across the system) and extends it with properties that correspond to custom fields defined for the page type.

Further configuration

After creating a new page type, you may want to continue with the following optional configuration: