Here you'll find an explanation of how content is defined and quick guide for your first go at it (based on an empty installation).
下面会解释内容是如何定义的,和快速指南(基于空白的页面)。
Before a piece of content can be created it needs to be defined. That is why, when opening a blank installation of Umbraco, it is not possible to create content in theContent section. All content needs a blueprint that holds information about what kind of data can be stored on the content node, which editors are used, how it is organized, where in the structure it is allowed and so forth. This blueprint or definition is called a Document Type.
一段内容在创建之前需要先定义。这就是为什么,当打开一个新安装的空白的没有预先模板的Umbraco,不能在内容部分创建内容。所有内容都需要一个蓝图,什么样的信息可以存储在数据内容节点中,使用什么样的编辑器,它是如何组织起来,在结构中的位置等等。这蓝图称为文档类型定义。
What is a Document Type?
文档类型是什么?
In it's most basic form a document type is a form containing fieldsets (or tabs) where you can apply rules about where the content can be created, which template(s) are allowed, backoffice icon and so forth.
Document Types can define entire pages or more limited content that can be reused on other nodes ie. a SEO tab. This means that you are in complete control of what type of content can be created where.
它最基本的一种组织文档类型的形式,是包含自定义字段(或标签), 这些字段您可以用来规定如何创建内容,允许哪些模板, 显示backoffice图标等等。
文档类型可以定义整个页面或部分内容,也可以重用在其他节点上,比如一个搜索引擎优化选项卡。这意味着你可以完全控制创建什么类型的内容。
Each field on a Document Type is called a property. A property is given a name, an alias (used to output the properties content in a template) and an editor. The editor determines what type of data the property will store and the input method. There are a wide range of editors available out of the box (textstring, Rich text, media picker and so forth) and you can customize and add additional editors.
Some editors require configuration, a configured editor is saved as a Data Type and can be re-used for multiple properties and document types. These can be seen in theDeveloper section under Data Types.
文档类型的每个字段被称为属性。一个属性有一个名称,一个别名(用于在template中显示属性内容)和一个编辑器。编辑器将决定什么类型的数据将被存储以及输入的方法。有很多内置的编辑器可用(textstring、富文本、媒体选择器等等), 你也可以定制和添加额外的编辑器。
一些编辑器需要配置下,配置好的编辑器可以被保存为数据类型,然后可以给多个属性和文档类型重用。这些在Data Types 下面的Developer 部分中可以找到。
Creating a Document Type
创建一个文档类型
A Document Type is created in the settings section using the Document Type editor.
Go to the Settings section in the backoffice. On theDocument Types node click the menu icon (•••) to bring up the context menu. Here chooseDocument Type. This will create a new Document Type with a template (can be found underTemplates in the Settings sections) that will be assigned as the default template for the document type.
一个文档类型是 使用文档类型编辑器 在settings部分创建 的。
到backoffice Settings 部分。在Document Types 节点上单击菜单图标(•••)弹出上下文菜单。现在选择Document Type 。这将创建一个新的文档类型与一个模板(可以在Settings 部分 的Templates 中找到),这个模板将被指派为文档类型 的默认模板。
You can also choose to create a Document Type without a template and create folders to organize your Document Types.
你也可以选择创建一个没有模板 的文档类型 ,然后创建文件夹来组织你的文档类型。
Defining the root node
定义根节点
First we're prompted to give the Document Type a name. This first Document Type will be the root node for our content, name it "Home".
首先我们会被提示给文档类型一个名称。第一个文档类型是我们的内容 的根节点,命名为“Home”。
Notice that the alias of the Document TYpe is automatically generated based on the name. If you want to change the alias simply click the "lock" icon.
注意,文档类型的别名是基于这个名字 自动生成的。如果你想改变别名只需单击“锁定”图标。
Having a root node makes it easy to query content as you know everything will be under the root node.
To set an icon for the Document Type click the document icon in the top left corner. This will open the icon select dialog. Search forHome and select the icon. This icon will be used in the content tree, choosing apropriate icons for your content nodes is a good way to give editors a better overview of the content tree.
有了一个根节点就很容易找到内容,因为你知道一切都会在根节点下。
点击左上角的文件图标来为文档类型设置一个图标,这将打开图标选择对话框。查找Home,选择图标。将这个图标用在内容树中,选择一个合适的图标可以让内容树看起来更清晰。

Go to the Permissions tab and tic the Yes - allow content of this type in the root checkbox and save the Document Type by clicking save in the bottom right corner.
去Permissions 选项卡并点击Yes - allow content of this type in the root 复选框然后右下角点击save来保存文档类型。

Creating the root node
创建根节点
Now go to the Content section, click on the menu icon next toContent and Select the Home Document Type. We'll name it "Home" and click theSave and Publish button.
现在去Content section ,单击菜单图标旁边的Content 并选择Home文档类型。我们命名为“Home”,点击“Save and Publish ”按钮。

As we haven't created our own properties all we can see on the "Home" node is the Properties tab which contains the default properties that are available on all content in Umbraco.
因为我们没有创建自己的属性,所以我们可以看到“Home”节点的properties选项卡包含的是默认属性,这些属性是在Umbraco所有content中都有的。
Let's add some properties of our own.
让我们添加一些自己的属性。
Tabs and properties
标签和属性
Go to the Settings section, expand Document Types by clicking the arrow to the left and select the Home Document Type.
去Settings section ,通过点击Document Types 左边的箭头,扩展 ,并选择Home 文档类型。
Before we start adding properties to the Document Type we need to create a tab to hold the property.
Click Add new tab and name the tab "Content".
在我们将属性添加到文档类型之前 ,我们需要创建一个标签来放置这些属性。
点击Add new tab ,命名为“Content ”。
If you have multiple tabs and/or properties you can order them with drag and drop or by entering a numeric sort order value. This is done by clickingReorder.
如果你有多个选项卡或属性,可以拖拽或输入一个值来排序。这是通过点击Reorder来做到 。
Now that we have created a tab we can start adding properties. Let's add a Rich Text editor to the Content tab.
Click the Add property link in the Content tab. This opens the property settings dialog. Here you can set the meta data for each property (name, alias, description), choose which data type/property editor to use and add validation if needed.
Give the property a name, the name will be shown to the editor so make relevant and easy to understand. Notice the alias is automatically generated based on the name. We'll name this "Body Text".
现在,我们已经创建了一个标签,我们可以开始添加属性了。让我们添加一个富文本编辑器到Content 选项卡。
单击Content 选项卡的Add property 。这将打开属性设置对话框。在这里你可以设置每个属性 的元数据(名称、别名、描述),选择使用哪个类型或者属性编辑器,以及是否需要添加验证。
为属性指定一个名称,名称将显示在相关的编辑器中,更容易理解。注意别名是基于这个名字 自动生成。我们命名这个“Body Text ”。

Clicking Add editor will open the Select editor dialog. Here you can choose between all theAvailable editors (this will create a new configuration) orReuse already configured editors. To make it easier to find what you need use the search field to filter by typing "Rich". Filtering will display configured properties first (under Reuse) and all available editors under that.
Select the Rich Text editor under Available editors.
点击Add editor 将打开选择编辑器的对话框。在这里你可以选择所有可用的编辑器(这将创建一个新的配置)或重用已经配置好的编辑器。在搜索框输入“Rich ”会更容易找到。结果将先显示配置好的属性(可重用),然后是所有可用的编辑。

This will let you configure the editor settings - the Rich Text editor for this property. Notice that the name of the Data Type (Home - Body Text - Rich Text editor) is based on the name of the Document Type, the name of the property and the property editor. Let's rename it to "Simple Rich Text editor" and only select the most necessary options.
这将允许您配置编辑器设置——这个富文本编辑器的属性 。注意,数据类型的名称(Home - Body Text - Rich Text editor )是基于文档类型的名称,属性的名称和属性编辑器的。让我们将它重命名为“Simple Rich Text editor ”,只勾选下面这些必要的一些选项。
- bold
- italic
- alignLeft
- alignCenter
- link
- umbMediaPicker
When you are happy with the settings click Submit.
当你设置好后单击Submit。
Checking the Mandatory checkbox makes the property mandatory and the content cannot be saved if no value is entered (into the Richtext editor in this case). You have the option to add additional validation by adding a regular expression in theValidation field.
Submit the property and save the Document Type. If you go to the Content section and click on the Home node you will now se the Content tab with the Body Text property.
点击Mandatory 复选框将强制检查属性,如果没有输入内容将不能保存。您可以选择 在Validation部分 通过添加一个正则表达式 来添加额外的验证。
提交属性并保存文档类型。如果你转到Content section ,然后点击主节点,现在可以看到有BodyText 属性的标签。
Defining child nodes
定义子节点
Next up we'll create a simple text page Document Type that will be used for subpages on the site.
Go back to the Settings section and create a new Document Type and name it "Text Page". Add a tab called "Content" and this time we'll add two properties. First make a property called summary using theTextarea editor and secondly create a property called "Body Text" and reuse theSimple Rich Text Editor Data Type.
接下来我们将创建一个简单的文本页面文档类型,它将用于网站的子页。
回到Settings sectio ,创建一个新的文档类型并将其命名为“Text Page ”。添加一个名为“Content”的标签,这一次我们会添加两个属性。首先使用Textarea 编辑器做一个叫summary的属性, 然后重用Simple Rich Text Editor 的数据类型来创建一个名为“Body Text ”的属性。
Creating child nodes
创建子节点
Before we can create a Text Page in the Content section, we need to allow the Text Page Document Type to be created as a child node to the Home node. Select the Home Document Type and go to thePermissions tab. Click Add child and select Text Page.
在我们可以创建一个 Content 部分 的文本页面的之前 ,我们需要允许Text Page 文档类型可以作为Home 节点的子节点来被创建。选择Home Document Type ,Permissions 选项卡。单击Add child 子,选择Text Page 。

Go to the Content section and click the menu icon (•••) next to theHome node and select the Text page Document Type. We'll name the page "About us". We now have a very basic content structure.
Content 部分,单击Home节点 边上的菜单图标(•••)并选择Text page 文档类型。我们命名这个页面 为“About us ”。我们现在就有了一个非常基本的内容结构。

Document Types are very flexible and can be used in a myriad of ways from defining a piece of reusable content or an entire page, to acting as a container or repository.
文档类型是非常灵活的,可以用各种各样的方式来自定义一个可重用的内容或整个页面,用来充当一个内容容器或存储库。