This topic is intended for administrators and developers with administration access rights in Episerver.
Properties are central in Episerver CMS. Properties are used in content types to store and present data, such as page types and block types, and they are the “fields” where editors enter information into a page type. A property can be for instance the page name, an image placeholder, or the editor area, where text can be added. For example, the XHTML editor is a property of the type “XHTML String (>255)”, which results in an editorial area in the page type when used. For property content to be visible to visitors, it must be linked to a content type with corresponding rendering.
Properties can be defined either in code or from the administrative interface. For certain properties defined in code, it is possible to do “non-breaking” changes in admin view to override these settings. If a property is defined in code and cannot be changed in admin view, information about this will be displayed. If you make changes to a property defined in code, it is possible to reset the changes to the values defined in code.
The following types of properties are used:
- Built-in properties are set by the system and are automatically available for all pages and blocks regardless of type. For example, PageName (name of the web page) and PageStartPublish (start publish date for the page).
- User-defined properties are added to the page or block type definition in code or from the admin view. Typical examples are Heading and MainBody.
- Dynamic properties are set on page level and inherited by child pages.
Property settings can be found under the Config tab in the Property Configuration section, and when working with content types under the Content Type tab.
A common example of property editing is to define toolbar buttons for the TinyMCE rich-text editor. Properties are normally defined in code but rarely added in admin view, since properties added from there are not rendered.
When editing and adding properties, the following tabs are available:
- Common Settings is where you edit a property's common settings.
- Custom Settings depend on the property data type being editing.
The upper General section of the Common Settings tab contains information about a selected property. If a property is defined in code, information about it is displayed, but you cannot change values such as property type and presentation control. You can change other settings, such as making a property mandatory or searchable. The lower User Interface part contains settings related to the property display in edit view.
Refer to Adding a Property below for more information about available settings for properties.
- In admin mode, from the Content Type tab, select a page type and click Add Property.
- In Type, select a property type. There are several property types to choose from: integer, string, page, date, etc. You can also create a property type.
- In Name, name the property. This is used when programming and making language settings.
- Mostly the TinyMCE editor is used, and the Presentation control drop-down list appears dimmed. Use of multiple editors is supported. If your website is configured to allow multiple editors and you chose the property type ”XHTML String (>255)”, the Presentation control drop-down list is enabled, and you can select the XHTML editor to use.
- Select if you want a default value for the property. This is the default value on all pages where it is used. You can specify a default value for both customized and built-in properties.
- Clear the Searchable property check box to exclude a property from search. It might be beneficial to avoid undesired property values the search index. By default, all properties are searchable.
- Select whether the property is unique for a certain language by selecting the Unique value per language check box. This is only needed if the website supports globalization.
- Select the Value must be entered check box to make it mandatory to enter a value for the property before saving. The setting is configured per property and content type.
- Use the Display in edit view check box to determine if the property is visible in edit view. By default, all properties are visible in the editorial interface. The setting is configured per property and page type.
- Specify a heading for the property in the Field name field. This text is displayed for the editor when editing the page in All Properties editing view unless a translation of it has been added language resources.
- Specify a help text in the Help text field. This text should help the editor understand how to use this property, and is displayed in All Properties editing view when hovering over the property name.
- Select the tab on which the property is to be displayed in the Tab drop-down list.
- Save the settings.
The Custom Settings tab displays custom information for the selected property type. Here, you define available buttons in the toolbar of the TinyMCE rich-text editor, which is based on the property type “XHTML string (>255)”.
When working with globalizationManaging content in multiple languages, and localizing the user interface., you define in every template which fields vary depending upon the language. To do this, set whether the property for that field should be “locked” or “open” for globalization. This is done using the Unique value per language setting in admin view.
Properties that have unique value per language are editable in all languages enabled on the website, which is normally the case. Properties that do not have language-specific values can only be edited in the language in which the page was created (the original page language). These properties are grayed out in edit view with an icon indicating the original language.
Imagine the property defining the sort order field is not set as a unique value per language (that is, the Unique value per language check box is not selected). When creating a new page, you can set sort order in the original page language. But if you create a version of the page in another language, the sort order field is not editable. As a result, the sort order is the same for all enabled languages. If you want to change the sort order for each language, select the Unique value per language check box.
If a property is changed to not having a unique value, all existing values for that property are deleted. This means that if the property for the editor area is changed to not have a unique language, all text entered in the editor area for all languages on the website are permanently deleted.
- On the Content Type tab, select the page type that contains the property to be set.
- Click the name of the property that you want to change.
- Select the Unique value per language option.
- Save your changes.
You can alter the order in which properties are displayed to editors in a page or block type. You can also move properties between tabs in a page type. These changes are done for each page type in admin view.
Follow these steps to change the order in which properties appear in the All Properties editing view. For example, you can display important properties at the top of the page.
- Select the page or block type on the Page Type or Block Type tab.
- Click an arrow to move a property, or drag and drop the property to a desired order.
- Select the page type on the Content Type tab.
- Click the name of the property that you wish to modify.
- In the Tab drop-down list, select the tab on which the relevant property will be placed.
- Save the settings.
Under Property Configuration and Edit Custom Property Types and Dynamic Properties, you can configure custom property types.
The property settings have the following priority:
- A specific setting for a property defined in admin view. This can be either a custom settings for this property or pointing to a specific global setting.
- A specific setting for a property defined for the model in code.
- A global setting defined in admin marked as the “Default” settings for the property type.
- A global setting defined in code.
Properties can be created, named, and given a data type and other settings. Property settings can be found in admin view under on the Config tab > Property Configuration for more information.
- Dynamic properties are inherited. When defined on a selected page, a property is inherited to the subpages. If you have other values stored on one of the subpages, you can choose to retain or overwrite the property values. Applying dynamic properties to pages is done from the Dynamic Properties option in edit view.
- Built-in property types can be edited under the Edit Custom Property Types section. User-defined property types can also be created and named here.
- Dynamic properties are added and edited under the Dynamic Properties section.
The list of available custom property types done by a developer has the following columns:
- Name is the name of the content type created by a developer, of which some are selectable in the editorial interface.
- Base type shows the built-in types that can be extended by a developer.
- Class name shows the full name of the class. The class is defined in the assembly.
- Assembly name shows the class reference. A blank column indicates a built-in property.
A developer can create property data types by inheriting from the existing available ones:
|Data type name||Base type||Description|
|Boolean||Selected/not selected||True or false.|
|FloatNumber||Floating point number||Number with decimals, for example, 3.14.|
|PageType||Page Type||Episerver CMS page type defined in admin view.|
|PageReference||Page||Link to an Episerver page in the current site.|
|Date||Date/Time||Date and time.|
|String||String (<=255)||Short text, fewer than 256 characters in length.|
|LongString||Long String (>255)||Used for text that can exceed 255 characters in length, for example the main editor area in edit view.|
|Category||Category selection||List of categories.|
|LinkCollection||Link collection||A collection of links that can be added and edited in edit view.|
Default values for properties are not defined in code.