Kentico CMS 7.0 Context Help

New document type

New document type

Previous topic Next topic Mail us feedback on this topic!  

New document type

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

This wizard guides you through the process of creating a new document type. In each step, perform the required configuration as described below and click Next.


Step 1


Fill in the following details:


Document type display name - name of the document type displayed in the system's user interface.

Document type code name - name of the document type object used by developers in project code. The code name is always preceded by a namespace, which allows you to have different document types of the same name used in different contexts.


Step 2


Choose one of the options:


The document type has custom fields - choose this option to create a new table in the system's database.

oTable name - the actual name of the table in the system database. The system pre-fills a name in the <namespace>_<code name> format automatically.

oPrimary key name - primary key column name, pre-filled with the <code name>ID value.

oInherits fields from document type - choose from which existing document type you want to inherit fields.


The document type is only a container without custom fields - creates a document type without you having to specify any custom fields.


Step 3


The field editor is displayed. It lets you define custom attributes for the document type and the appearance of the attributes in the editing forms.


Based on the Attribute type that you choose for the attribute, a set of the following field options may be available:


Field values available based on the attribute typeField options




This option is displayed only when adding or editing a system attribute. It is used to specify which type of columns will be available for selection. There are two possible options:


Document attribute - offers the system fields of documents.

Node attribute - offers the system fields of document's content tree nodes.

Column name

Sets the name used for the database column storing the values of the field. It also serves as an identifier for the field.

Attribute type

Type of value that the field should contain.

Attribute size

Sets the maximum amount of characters that can be entered into the field. Only available if the Attribute type is set to Text.

Allow empty value

If enabled, the field allows empty values.


If disabled, users cannot save the editing form unless there is a value entered in the given field. In this case, the field is required and an asterisk (*) is displayed next to it.

Default value

Default value of the field that will be pre-filled when documents of this type are created.

Translate field

Indicates if the field should be included when translating documents of this type using translation services.


Only available if the selected Attribute type is Text, Long text or File.

Display attribute in the editing form

If this property is not checked, the given field will not be available when editing documents of this type.

Field appearance

Field caption

Sets the text displayed in the editing form next to the field.

Form control

Selects the form control that should be used in the editing form to interact with the given field.


If the form control that you need is not available in the drop-down list, you should be able to assign it through the dialog opened via the (more items ...) option.

Field description

Tooltip which will be displayed if a user hovers over the field.

Editing control settings

The settings in this section are used to perform additional configuration of the selected Form control, which affects the behavior or appearance of the field. The available options depend on the parameters defined for the given form control. Please see the tooltips of individual settings for more information.


This section also has two available modes. You can switch between Advanced and Simplified mode using the link on the side of the section. In simplified mode, only a limited set of parameters is offered (typically the most important ones).


Spell-check this field

If enabled, this particular field will have the option of being spell checked when editing documents of the given type on the Form tab in CMS Desk -> Content -> Edit. Only available if the selected Attribute type is Text or Long text.

Regular expression

This regular expression will be used by the validator of the field. Only available if the selected Attribute type is Text or Long text.

Min/Max length

Sets the minimum/maximum length for entered values. Only available if the selected Attribute type is Text or Long text.

Min/Max value

Sets the minimum/maximum value that can be entered. Only available if the selected Attribute type is numerical.


Can be used to specify a time interval into which the entered value must belong. Only available if the selected Attribute type is Date and time.

Error message

Error message displayed if a user enters invalid input into the field and attempts to save the form.

CSS styles

Caption style

Used to set CSS styles for the caption of the given parameter's field.

Input style

Used to set CSS styles for the input entered into the parameter's field.

Control CSS class

Name of the CSS class used to style the parameter's field.

Field advanced settings

Visible condition

May be used to enter a macro condition that must be fulfilled in order for the specific field to be visible in the editing form.


You can write any condition according to your specific requirements. For details about available macro options and syntax, please refer to the Development -> Macro expressions chapter of the Developer's Guide.


If you wish to create a condition that depends on the state of the document type's other fields, you can access them in the macro expression using the corresponding Column name. The data of the fields may then be retrieved through the following properties:


Value - returns the current value of the field. For example, NewsTitle.Value is resolved into the value entered into the NewsTitle field.

Visible - returns a true value if the given field is currently visible in the form.

Enabled - true if the field is currently enabled, i.e. its value can be edited.

Info.<field setting> - may be used to access various settings configured for the field, for example: NewsTitle.Info.Caption

Enabled condition

Allows you to enter a macro condition that determines when the field should be enabled. If this condition is resolved as false, the field will be visible, but it will not be possible to edit its value.


You can use the same macro options as described above for the Visible condition property.

Has depending fields

If enabled, the editing form will be refreshed via autopostback whenever the value of the given field is changed. This means that other fields can be dynamically updated according to the current value of the field.


Please note that the actual logic of the dependencies needs to be implemented in the code of the used form controls.

Depends on another field

This option must be enabled if you wish to have the behavior of the field dynamically changed according to the value of some other field.


The following properties are available when creating or editing categories:



Category name

Sets the name of the category that is displayed in the editing form.


If enabled, users will be able to collapse and expand the content of the category.

Collapsed by default

If enabled, the category will initially be collapsed when the form is loaded.


Indicates if the category and all of the fields under it should be visible in the form.

Visible condition

May be used to enter a macro condition that must be fulfilled in order for the category to be visible. You can use the same macro options as described above for the Visible condition property of fields.



Use the Save Save button at the top of the page before proceeding to a different attribute.


Step 4


Choose the source for the document name using the Document name source drop-down list.


The drop-down list allows you to:

Use document name fields - uses the display name that you entered in Step 1.

Pick a column name that you defined for a custom attribute.


Step 5


Select parent document types for the document type you are creating. Use Add document types to add document types to the list or Remove selected to remove already listed document types.


Step 6


Select on which websites will the document type be available. Use the Add sites button to add the required websites to the list, or the Remove selected button to remove the already listed websites selected by the check-boxes next to them.


Step 7


Here, you can configure indexing of data in the document type by the Smart Search module.


In the top part, you can specify how items from this document type are displayed in search results:


Title field - specifies which field is be used as the title of the search result.

Content field - specifies which field is used for the content extract of the search result.

Image field - specifies which field is used for the image of the result item.

Date field - specifies which field is used for the date and time displayed with the search result.


Lines of the table in the bottom part of the page represent fields defined on the Fields tab, while columns define the following:


Content - if checked, content of the field will be indexed and searchable the standard way.

Searchable - if checked, content of the field will be searchable in format <field code name>:<searched phrase>. This format searches through the specified fields only.

Tokenized - indicates if the content of the field should be processed by the analyzer when indexing; the general rule is to use this for Content fields and not for Searchable fields.

Custom search name - relevant for Searchable fields; substitutes field code name in the <field code name>:<searched phrase> expression; if entered, the original code name can't be used.


For more information about smart search object settings, refer to Developer's Guide -> Modules -> Smart search -> Obejct settings.


Step 8


The last step gives you an overview of what the system has done automatically. To finish the wizard, click Finish. The system redirects you back to the general tab of the document type that you just created.


Additional resources


For more details about defining a new document type, refer to the Defining a new document type section in Kentico CMS Developer's Guide.


You can find detailed information on document types and transformations in Developer's Guide -> Development -> Document types and transformations.