The administration interface for custom tables management is located in Site Manager -> Development -> Custom tables.
The top part of the page is a filter. You can filter displayed custom tables by Display name, Code name and Table name. You can also Edit () or Delete () the listed records. Creating a new custom table is also done here and is described in the following example:
New Custom table wizard
In the following example, we will create a new custom table using the New custom table wizard. It will be a simple table for storing information about people. Their first names, last names and dates of birth will be stored in the table.
1. Go to Site Manager -> Development -> Custom tables.
2. Click the New Custom table link.
3. The New Custom table wizard starts. On the first step of the wizard, you are asked to fill in the custom table's display name and code name. The code name is always preceded by a namespace which allows you to have different tables of the same name used in different contexts. Enter the following details:
• | Custom table display name: People |
• | Custom table code name: customtable.People |
and click Next to continue.
4. In the second step, you are asked to fill in the database table name. A name in the format <namespace>_<code name> is pre-filled automatically. The primary key name cannot be changed by default. Using the check-boxes below, you can determine which of the default fields should be included in the table. The meanings of the fields are the following:
• | ItemCreatedBy - user name of the user who created the item |
• | ItemCreatedWhen - date and time of when the item was created |
• | ItemModifiedBy - user name of the user who last modified the item |
• | ItemModifiedWhen - date and time of last modification |
• | ItemOrder - order of the item when table content list is displayed; the lower number, the earlier position in the list |
Leave default values for all parameters and click Next to continue.
5. In the third step, the field editor that you should be already familiar with is displayed. Create three fields with the following parameters:
• | Attribute name: FirstName |
• | Attribute type: Text |
• | Attribute size: 100 |
• | Field caption: First name |
• | Field type: Text box |
• | Attribute name: LastName |
• | Attribute type: Text |
• | Attribute size: 100 |
• | Field caption: Last name |
• | Field type: Text box |
• | Attribute name: DateOfBirth |
• | Attribute type: Date and Time |
• | Field caption: Date of birth |
• | Field type: Calendar |
• | Edit time: unchecked |
When you are finished, click Next to continue to the following step.
6. On Step 4, you only have to select by which sites will the custom table be used. Click Add sites and choose Corporate Site in the pop-up dialog. Finally click Next to proceed to the following step.
7. Step 5 offers you to set up how items in the custom table will be indexed using the Smart Search engine. The four drop-downs at the top determine which fields of the table will be displayed in the search results. Change the values to the following:
• | Title field: LastName |
• | Content field: FirstName |
• | Image field: none |
• | Date field: ItemModifiedWhen |
Leave the rest of the settings at the default values and click Next. For more information about settings in this step, please refer to this chapter.
8. The fifth step gives you an overview of what has been done automatically. To finish the wizard, click Finish. You will be redirected back to the list of custom tables in Site Manager -> Development -> Custom tables.
Page url: http://devnet.kentico.com/docs/devguide/index.html?managing_custom_tables.htm