All data types assignable via the field editor must be explicitly registered. The system uses the metadata provided during registration to:
Not every data type is offered everywhere. Each data type declares the kinds of objects whose fields can use it, so the set of options in the field editor differs between content types, reusable field schemas, customizable data classes, and custom module classes. For details, see Data type configuration.
The following table highlights important data types registered by default:
Field editor name | C# data type | Database representation | Notes |
|---|---|---|---|
Boolean (Yes/No) | bool | bit (opens in a new tab) | |
Integer number | int | int (opens in a new tab) | |
Long integer number | long | bigint (opens in a new tab) | |
Decimal number | decimal | decimal (opens in a new tab) | |
Date | DateTime | date (opens in a new tab) | |
Date and time | DateTime | datetime2 (opens in a new tab) | Time values are stored in the time zone of the server where the application is running. However, the administration UI automatically converts and displays time in the local time zone of each user, based on browser and environment settings. |
Time interval | TimeSpan | time (opens in a new tab) | |
Text | string | nvarchar (opens in a new tab) | This data type is not intended to store rich text content (formatted text that includes links, e.g., created using the rich text editor) – use the Rich text (HTML) data type instead. Database field length is configurable when creating or editing fields (up to the database maximum). |
Long text | string | nvarchar(max) (opens in a new tab) | This data type is not intended to store rich text content (formatted text that includes links, e.g., created using the rich text editor) – use the Rich text (HTML) data type instead. |
Rich text (HTML) | string | nvarchar(max) (opens in a new tab) | Represents rich text content created with the rich text editor. This data type also ensures that usage of content items is tracked correctly. |
Unique identifier (GUID) | Guid | uniqueidentifier (opens in a new tab) | |
Content item asset | ContentItemAssetMetadata | nvarchar(max) (opens in a new tab) | Binary data attached to a content item. This data type is only available in fields of reusable content types. |
Pages and reusable content | IEnumerable<ContentItemReference> | nvarchar(max) (opens in a new tab) | Represents a collection of content items and pages referenced by a specific content type field. |
Media files (obsolete) | IEnumerable<AssetRelatedItem> | nvarchar(max) (opens in a new tab) | Represents a collection of media files. This data type has been sunset along with media libraries and will soon be removed. See Media library migration. |
Emails | IEnumerable<EmailRelatedItem> | nvarchar(max) (opens in a new tab) | Represents a collection of emails from an email channel, referenced by a specific field. For example, chosen by the email selector component. This data type is only available in fields of system tables and custom module classes. |
Pages | IEnumerable<WebPageRelatedItem> | nvarchar(max) (opens in a new tab) | Represents a collection of pages from the content tree of a selected website channel. For example, chosen by the page selector component. |
Headless items | IEnumerable<HeadlessItemReference> | nvarchar(max) (opens in a new tab) | Represents a collection of headless items from a headless channel. For example, chosen by the headless item selector component. This data type is only available in fields of headless content types. |
Smart folder | SmartFolderReference | uniqueidentifier (opens in a new tab) | Represents a smart folder selected via the Smart folder selector component. This data type is only available in fields of reusable and website content types, and in fields of reusable field schemas. |
Taxonomy | IEnumerable<TagReference> | nvarchar(max) (opens in a new tab) | Represents a collection of tags selected via the tag selector component. This data type is only available in fields of content types and reusable field schemas. |
Object code names | IEnumerable<string> | nvarchar(max) (opens in a new tab) | Represents a collection of object code names selected via the object code name selector component. This data type is not available in fields of headless content types. |
Object global identifiers | IEnumerable<Guid> | nvarchar(max) (opens in a new tab) | Represents a collection of object GUIDs selected via the object guid selector component. This data type is not available in fields of headless content types. |
No referential integrity for linked objects
The system doesn't maintain the referential integrity of objects linked via the Pages and reusable content, Media files, Emails, Pages, and Object code names data types. Custom code must account for the referenced objects no longer existing or being otherwise invalid.
When none of the default data types fits the data you need to store, you can register your own. A custom data type declares its own C# type, database representation, and conversion functions, and becomes assignable via the field editor like any built-in type. See Add custom data types.