Add fields to existing objects

Introduction

To add fields to objects you will actually create a new object type that INHERITS from the other type. It is done this way because of the way E-Site and modern programming languages work. Inside the E-Site system new classes will be generated "on the fly" and extended with your desired new fields. This is done behind the scenes and you don't need to do this, but it might be handy to know.

Note: It is actually possible to change an object type in E-Site directly but not recommended, the reason this is not recommended is because it can be overwritten when downloading updates unless you disable updates for this object type. Disabling updates is not recommended as it means you will miss new features and updates such as security updates.

This is how you go at it:

Step 4 - The "Object type editor"


Step 4 - The
The editor below will open. From this editor you can edit the object type.

You have the following buttons on the toolbar containing functions listed on right:

  • New - Extend or add new fields with the functions on this
  • Delete selected - Deletes selected field in the treeview below
  • Open all - Expands all nodes in treeview
  • Actions - Navigate to other object types, view the XML for this type, open another object type by name, view list of all object types, create new type, convert all objects of this type to something else, give this object type a new GUID, Reset the version counter for this type, delete type
  • Data - View the generated code in VB or C#, View SQL table creation script, Generate object type from table utility, Create typed table in database for this type, validate values for objects of this type, validate site and delete all objects of this type
  • Save - Saves the changes you have done.

Step 1 - Create a new object type


Step 1 - Create a new object type
Click the developer button from E-Site

Step 3 - Enter type name


Step 3 - Enter type name
Enter in the "Name" field a new unique name for your object type. If you intend to disable the old object type and keep the old name you can add a non-visible name space in front of it seperated to the name as shown in the example below. In the "Inherit" field enter the name of the object type you want to extend.

Step 2 - Click create new type


Step 2 - Click create new type

Step 5 - Example of adding fields to the introduction page


Step 5 - Example of adding fields to the introduction page
Click the new button, extend and select what page or node in the object you want to add a field to.
In this screenshot is an example of how to tell the editor you want to extend the "Introduction_page" element.

Step 6 - Introduction_page added for extension


Step 6 - Introduction_page added for extension
The "Introduction_page" is now added to your editor as shown below.
You can now add new fields to it by selecting it and add new "elements" from the "New" button on the toolbar.

Step 7 - Add new element


Step 7 - Add new element
Click the "Introduction_page" element and click New, then select the "Empty" item.

Step 8 - An empty element is added


Step 8 - An empty element is added
As shown below a new element is added to the treeview. Double click this to configure the properties for it.

Step 9 - Configure new element


Step 9 - Configure new element
Give it a desired name, then choose desired field type in the "Property type" drop down as displayed in the image below.

Step 10 - Save your changes


Step 10 - Save your changes
Click the save button on the far right.

Step 11 - Open a folder and click new


Step 11 - Open a folder and click new
You will now notice that there are 2 "Article" items on your menu. You might want to disable the old "Article" object type in this case. This can be done from the object type editor by opening the object type "Article" (in this case) and unchecking the "Enabled" check box.

Step 12 - See the new field in action


Step 12 - See the new field in action
By clicking the new "Article" type (done by trial, error and guessing in this exact case as they have identical names). When scrolling down to the bottom of the "Introduction_page" the newly added field is located.
You can also see that the "Link text" field is actually below it. This is because the "Order" attribute on the fields have been used and the "Link text" attribute has a very high number. You can change these around to order them the way you want.