Prev Next |
As mentioned above, Fields are actually defined by a special set of Items based on the Template Field Template. Field Items have a few Item related properties described in the Item Properties section below. The Template Field Template defines a Data Section which includes a number of properties which define the behavior of the Field in the Content Editor. The Data Section properties are defined in the Data Properties section below.
The Template Field Template inherits from the Standard Template, which means that Field Items include all the Sections defined by the Standard Template. In many cases, the Fields inherited by the Standard Template do not make sense in relation to a Field definition. In these cases, the value of these inherited Fields is ignored. For example, the Layout section does not apply to a Field, therefore, any values set in this section are ignored.
1.1. Item Properties
All Fields have a few special properties. These properties are set when the developer creates the Field. Each of these properties is described below.
-
Name
The name the developers assigns to the Field when they create it.
By default, this corresponds to the Title displayed above the Field in the Content Editor, but the Title is actually specified elsewhere (see the Title property description). After the Field is created, changes to the Name and Title no longer influence each other.
-
Key
The Field name in lower-case. Developers use the Key when extracting the Field contents in XSL renderings and Web Controls. When a developer renames a Field, the Key is updated as well.
-
ID
Each Field is automatically assigned a unique ID when it is created (implemented as a GUID). This is used internally to bind the Field value in an Item to the Field definition in the Item’s Template.
1.2. Data Properties
The Data Section includes the most commonly set properties associated with a Field. Each of these is described below.
-
Type
The data type of the field. This specifies which user interface control the Content Editor will display to accept input for this Field. Please refer to the Standard Data Types section for more information about the default data types.
-
Title
The Field name displayed above the Field in the Content Editor. By default, this is set to the Field’s name, but you may change the value if you wish.
-
Source
The Source property has different meanings depending on the value of the Type property. Please refer to the appropriate Standard Data Types section for more information.
-
Shared
When this checkbox is set, the Field in question will have the same value for all versions of the parent Item. When the Shared property is set, changes to the Field value in any language or numbered version of the Item will be reflected in all other languages and versions.
For example, imagine a Product Template that includes a Part Number Field. If the business requirements for Products indicate that the Part Number does not change and is the same regardless of which language the Product is viewed in, then the developer would set the Shared property for the Field.
Note: Enabling this property alone has the same effect as selecting both the shared and unversioned properties.
Note for both Shared and Unversioned: When Shared and/or Unversioned are enabled, the field values will not support workflow restrictions
Let us take the picture above as an example. We have a Sample Item with 2 text fields, “Title” and “Corporate Title”. “Title” is a plain text field with neither the Shared nor Unversioned box checked. Now imagine we have two versions of this item and version 1 has been published and version 2 is in a non-final workflow state. If I change the “Title” field in version 2, the new field value will not be published out to the website until version 2 is moved into a final workflow state. If I change the “Corporate Title” field in version 2, however, version 1 will reflect that change as well, which means that the new field value will be published during the next publish operation, even though version 2 is still in a non-final workflow state. Therefore, you should only enable shared and unversioned properties for fields that are not displayed on the website or that do not require workflow validation before publishing.
-
Unversioned
When this checkbox is set, the Field in question will have the same value for all numbered versions of the parent Item, but may have different values for each language.
For example, in the Product Template described above, if the Product has a Part Name which does not change between versions, but has different values in different languages, then the developer would set the Unversioned property for the Field.
Note: Please consider carefully the note Note for both Shared and Unversioned listed under Shared before using this checkbox.
-
Default Value
The default value of the Field. This property is ignored for some data types. Please refer to the appropriate Standard Data Types section for more information.
-
Validation
A regular expression that the field must match. This property allows you to make sure that text in the field matches a certain pattern. For example, to make sure that only a valid email address can be saved in the field you can use the following regular expression:
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
If entered text does not match the pattern, the ValidationText is shown in a dialog and the item is not saved.
You can find more information about regular expression language elements on MSDN.
A good collection of prewritten regular expression patterns can be found on Regular Expression Library web site.
ValidationTextThe error message displayed if the validation fails.
-
Field Security
In this section, you can assign users rights for the particular field. Please refer to the Assigning Rights article for more information concerning rights assignment.
Note: only Read and Write rights make sense for fields, other rights are ignored.
-
Reset Blank
When selected, Field values that are blank are set to a NULL value, rather than an empty string.
1.3. Help Properties
There are three help properties for every field. These properties can be edited in the help section of a field’s template. Each of these is described below.
-
Short description
The short description is shown to the right of the title of the field
-
Long description
The Long description is shown when the user holds the pointer over the field for a moment
-
Help Link
When the help link is specified, the title of the field will be rendered as a link to the specified page.
Prev Next