This page describes how to create page types in the Page types application.
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.
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.
Select the features that you want to enable for the page type, depending on the intended purpose of the given pages:
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.
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.
Enter a Table name for the database table that stores the data of the page type's fields.
Enter a Primary key name for the table.
(Optional) Select if you want the page to Inherit fields from page type (reuse the field structure of an existing page type).
Click Next.
The system creates the database table.
Now, you need to define the page type's data fields (columns of the table):
Click New field.
Define the custom field using the field editor.
Click Save.
Repeat the steps above for all required fields.
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 or node system fields are then offered in the Field name drop-down list.
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).
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:
For detailed information, see: Page database structure
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:
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.
After creating a new page type, you may want to continue with the following optional configuration: