A Data Type defines the type of input for a property. So when adding a property (on Document Types, Media Types and Members) when selecting the Type you are selecting a Data Type. There are a number of of preconfigured Data Types available in Umbraco and more can be added in the Developer section.
一个数据类型定义了一个属性的输入类型 。当添加一个属性(文档类型、媒体类型或成员的属性)时,在选择类型是,你需要选择一个数据类型。有许多可用的预置的数据类型在Umbraco中可用,也可以开发者自己添加新的。
What is a data type?
数据类型是什么?
A Data Type can be something very simple (textstring, number, true/false,...) or more complex (multi node tree picker, image cropper, Grid Layout).
The Data type references a Property Editor and if the Property Editor has settings these are configured on the Data Type. This means you can have multiple Data Types referencing the same Property Editor.
An example of this could be to have two dropdown Data Types both referencing the same dropdown Property Editor. One configured to show a list of cities, the other a list of countries.
数据类型可以是非常简单的(如textstring、数量、真/假…)或者更复杂的(多节点树选择器、图像切割,网格布局。。)。
数据类型与属性编辑器有关。多个数据类型可以引用同一个属性编辑器。
一个例子,可以有两个下拉数据类型都引用同一个下拉属性编辑器。一个显示城市的列表,另一个现实其他国家的列表。
Creating a new Data-Type
创建一个新的数据类型
To create a new Data Type go to the Developer section and click the menu icon to the right of
Data-Types and select
Create. Name the Data Type, we'll call it "Dropdown Cities".
创建一个新的数据类型,去Developer 部分,单击Data-Types右边的 菜单图标 ,并选择Create 。命名为“Dropdown Cities ”。

-
Property Editor: This is where you pick the Property Editor that our Dropdown Cities Data Type will be referencing. Pick the Dropdown List and now you will see the cofiguration options that are available for a Data Type referencing the Dropdown List Property Editor.
-
Property Editor Alias The alias of the Property Editor being used.
-
Add prevalue: Here you can add prevalues to this Data Type by entering the value you want into the input field and pressing the
add button. For the "Dropdown Cities" list this could be:
- Property Editor :这是你给Dropdown Cities 数据类型选择的属性编辑器。选择Dropdown List ,现在您将看到数据类型的下拉菜单的cofiguration选项。
- Property Editor Alias :被使用的属性编辑器的别名。
- Add prevalue :在这里你可以添加数据类型 的预置值,在输入框中 输入你想要的值,点击Add按钮。“Dropdown Cities ”名单可能是:
-
When you're happy with the list press Save and it is now possible to select this Data Type for a property on Document Types, Media Types and Members. This will then create a dropdown list for the editor to choose from and save the choice as a string.
当你改好后,点击Save,现在就可以在文档类型,媒体类型和成员 中选择这个数据类型来作为属性了。这将创建一个下拉列表,可以选择,并保存选择的字符串。
Customizing Data-Types
自定义数据类型
To customize an existing Data Type go to the Developer section, expand the Data-Types node and select the Data Type you want to edit.
Aside from the Data Types that are available out of the box there are some additional Property Editors to choose from such as the
Slider and
Macro Container.
定制一个现有的数据类型,可以去Developer 部分,扩展Data-Type节点并选择想要编辑的数据类型。
除了可用的数据类型的属性编辑器外,还有一些额外的选择如Slider 和Macro Container 。
More information
Related Services
Umbraco.tv