Defining a new page type (ASPX)

Each page in Kentico is of a certain type, such as page, news, product, article, etc. Every page type has its own data fields. The page type describing computer products will have fields storing the computer name, processor type, RAM size, disk size and product image.

  1. Open the Page types application.

  2. Click New page type. This starts the New page type wizard.

  3. Enter the following values in Step 1:

    • Page type display name: Computer (the system displays this name to users in the administration interface)

    • Namespace: custom (namespace to distinguish your page types from the default system types that use the cms namespace)

    • Name: computer (the identifier of the page type)

      Setting names for the new page type

  4. Click Next.

  5. In Step 2, specify the name of the database table where the system stores the data of computer pages. You also need to enter the name of the table’s primary key field. Leave the default values.

  6. Click Next. The system creates a new database table for computer pages.

  7. In Step 3, you need to define the fields of the page type (columns of the table). Click New field to create the following fields. For each field, enter the values, click Save and repeat the procedure until you have defined all the listed fields.

    • Field name: ComputerName

    • Data type: Text

    • Size: 200

    • Required: yes (checked)

    • Field caption: Computer name

    • Form control: Text box

    • Field name: ComputerProcessorType

    • Data type: Text

    • 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:

      
      
      
      Athlon;Athlon
      Pentium XEON;Pentium XEON
      Pentium Core 2 Duo;Pentium Core 2 Duo
      
      



    • Field name: ComputerRamSize

    • Data type: Integer number

    • Field caption: RAM (MB)

    • Form control: Text box

    • Field name: ComputerHddSize

    • Data type: Integer number

    • Field caption: HDD (GB)

    • Form control: Text box

    • Field name: ComputerImage

    • Data type: File

    • Field caption: Image

    • Form control: Upload file

    Defining the fields of a new page type

  8. Click Next.

  9. In Step 4, choose the ComputerName field as the Page name source.

    This means that when a user creates a new computer page, the system automatically fills in the page name based on the ComputerName value. The page name appears in site navigation and in the content tree of the Pages application.

  10. Click Next.

  11. In Step 5, select the page types that will be supported as parents for computer pages in the content tree. Click Add page types, select the Page (menu item) page type and click Select. This means that users are only allowed to place computer pages under pages, not under articles, news items or other page types.

  12. Click Next.

  13. In Step 6, assign the page type to all websites where you wish to use it. Click Add sites, choose My website in the selection dialog and click Select.

  14. Click Next.

  15. Click Finish to complete the creation of the new page type.

The wizard automatically creates the database table and several default transformations.

How does the system store page content?

The system stores page content and all related data in three database tables:

  • CMS_Tree (content tree structure)
  • CMS_Document (general page properties, metadata and editable region content)
  • A dedicated page type table - in this case CUSTOM_Computer (stores the values of the page type’s specific fields)