New document type |
Top Previous Next |
Each document in the Kentico CMS repository is of some type, such as news, product, article, etc. Each document type has its own fields. Our document type will describe computer, so it will have a computer name, processor type, RAM size, disk size and a product image field.
Go to Site Manager -> Development -> Document types and click New document type. You are redirected to the New document type wizard. In the first step, enter the following values:
Click Next.
In step 2, you need to choose the name of the database table that will be used for storing computer details. You also need to enter the name of the primary key in this table. Leave the default values:
Click Next. The wizard has created a new database table for computers. Now you need to define the fields (columns of the table). Click New attribute to create a new field. Enter the following values:
Click OK. Click New attribute. Enter:
Athlon;Athlon Pentium XEON;Pentium XEON Pentium Core 2 Duo;Pentium Core 2 Duo
Click OK. Click New attribute. Enter:
Click OK. Click New attribute. Enter:
Click OK. Click New attribute. Enter:
Click OK.
Click Next.
Now you need to choose the field that will be used as document name. Choose the ComputerName field. It means that when you create a new computer document, its name will be automatically taken from the ComputerName value and this value will appear in site navigation and in CMS Desk content tree.
Click Next. In step 5, you need to select the document types under which the computers can be added in the content tree. Check only the Page (menu item) value, which means the editors will be able to create computer documents only under some page, not under article or news document in the content tree.
Click Next. In step 6, you need to choose which web sites will use this document type. Check My web site.
Click Next. In Step 7, you are asked to specify how documents of this type should be indexed for searching and displayed in search results. Select the following values in the drop-downs:
Leave the default values for the rest of the options and click Next.
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, DELETE operations and a default transformation.
You have learned how to define a new document type.
|