Properties

  • Updated
This topic is for CMS administrators and developers with administrative access rights.

Properties are key elements in Optimizely Content Management System (CMS). Content type properties store and present data, such as page types and block types, and they are fields where editors enter information into a page type. A property can be the page name, an image placeholder, or the editor area, where you can add text. 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, link it to a content type with the corresponding rendering.

Property types

You can define properties in code or from Settings > Content Types > {select content type} > Properties. You can create "non-breaking" changes in the Settings view for certain properties defined in code to override these settings. Information displays if a property is defined in code and cannot be changed in the Settings view. If you change a property defined in code, you can reset the changes to the values defined in code.

The following types of properties are used:

  • Built-in properties – Set by the system and are automatically available for 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 – These are added to the page or block type definition in code or from the admin view. Typical examples are Heading and MainBody.

You can locate property settings Settings > Content Types > {select content type} > Properties when you work with content types. 

Create page properties

  1. In the Settings view, select Create New > Page Type (or Block Type) from the Content Type tab.

    create-new-page-type.png

  2. Enter the page information.

    Create-page-marketing-creatives.png

  3. Select Add Property to define the properties for the page type. See the following section for more details about adding a property.

    Create-page-marketing-creatives-2.png

Add a property

  1. In Settings view, from the Content Type tab, select a content type from the list and click Add Property
  2. Select the property type you want. 

    add-property-1.png

    The legacy content types are not available on SaaS Core. You should use the primary content types because the legacy content types will be removed in the future.

    add-property-2.png

    You can change the type in the Configure Property view that displays.

    property-2.png

  3. Fill in the fields in the Configure Property view.

    Properties-1.png

    Each type may have different validations display. The following fields belong to the Content type.
    • Name – Name the property. This is used when programming and making language settings.
    • Type – Select a property type. You can choose from several property types: integer, string, page, date, and so on. You can also create a property type.

      When you select a basic data Type, you also select its subtype. For example, if you select Content, you also select the Content Type (Content Area, Content Area Item, or Content Reference); if you select Text, you also select the Text Type (Long string (>255), String (<=255), or XHTML string (>255)), and so on.

      When you select a Content Type, you may have additionally Allowed Content Types or Restricted Content Types that an editor can see for this property.

      property-3.png

    • Value must be entered – Select the check box to make it mandatory to enter a value for the property before saving. The setting is configured per property and content type.
    • Unique value per language – Select whether the property is unique for a certain language. This is needed only if the website supports globalization.
    • Searchable property – Clear the check box to exclude a property from search. It might be beneficial to avoid undesired property values in the search index. By default, all properties are searchable.
    • List – Select to make the property a list property. This displays only for some properties. See List property examples.
    • Default value – Select a value for the property: No default value, Inherits value, or Custom properties.
    • Display in edit view – Select whether the property is visible. By default, all properties are visible in the editorial interface. The setting is configured per property and page type.
    • Display name – Specify a heading for the property. This text displays for the editor when editing the page in the All Properties view unless a translation was added to language resources.
    • Help text – Specify a help text to help the editor understand how to use this property, and it displays in the All Properties view when hovering over the property name.
    • Sort index – Select a relative number to sort this property among other properties.
    • Tab – Select the tab on which the property will be displayed in the Tab drop-down list.
  4. Click Save.

The Custom Settings tab displays custom information for the selected property type.

Define language-specific properties

When working with globalization, you define in every template which fields vary depending upon the language. To do this, set the property for that field to "locked" or "open" for globalization using the Unique value per language setting in the admin view.

Properties with unique values per language are editable in activated languages on the website, which is normally the case. You can edit only properties that do not have language-specific values in the language in which the page was created (the original page language). These properties are deactivated 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 cleared). You can set the sort order in the original page language when creating a page. 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 activated languages. If you want to change the sort order for each language, select the Unique value per language check box.
Existing values are deleted if a property is changed to not having a unique value. So if the property for the editor area is changed not to have a unique language, text entered in the editor area for all languages on the website is permanently deleted.

Set a property to be language-specific

  1. On the Content Types tab, select the page type that contains the property to be set.
  2. Click the name of the property that you want to change.
  3. Select the Localized option.
  4. Click Save.

Place a property on a tab

  1. Select the page type on the Content Types tab.
  2. Click the name of the property that you want to modify.
  3. In the Tab drop-down list, select the tab where the relevant property will be placed.
  4. Click Save.

Configure customized property settings

You can configure custom property types.

Priorities and configuration

The property settings have the following priority:

  1. A specific setting for a property is defined in the admin view. This can be custom settings for this property or pointing to a specific global setting.
  2. A specific setting for a property is defined for the model in code.
  3. A global setting defined in admin is marked as the Default setting for the property type.
  4. A global setting is defined in code.

You can create a property, name it, and give it a data type and other settings.

Create custom property types

The list of available custom property types done by a developer has the following columns:

  • Name – 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 a developer can extend.
  • 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 or not selected True or false.
Number Integer An integer.
FloatNumber Floating point number Number with decimals, for example, 3.14.
PageType Page Type Optimizely CMS page type defined in admin view.
PageReference Page Link to an Optimizely page on the current site.
Date Date or Time Date and time.
String String (<=255) Short text, fewer than 256 characters in length.
LongString Long String (>255) Used for text exceeding 255 characters, such as 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.

List property examples

When you select the List property box, you can define many list types in the All Properties view of a page. The following examples show the List property examples.

EditorialBlock List type

Click Add Editorial to add another list item; select More > Delete to remove a list item.

List-type-1.png

Enumerable of ContentReference List type

Click Select Content to add another list item; select More > Delete to remove a list item.

List-type-18.png

Enumerable of ContentReference List type (with PropertyCollection)

Click Select Content to add another list item; select More > Delete to remove a list item.

List-type-6.png

Enumerable of ContentReference List type (with Image UIHint)

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-15.png

Enumerable of ContentReference List type (with Video UIHint)

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-16.png

DateTime List type

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-9.png

Enumerable of int List type

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-3.png

Enumerable of int List type (with PropertyCollection)

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-4.png

Enumerable of LinkItem List type

Click Add Link to add another list item; select More > Delete to remove a list item.

List-type-12.png

Enumerable of LongString List type

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-17.png

Enumerable of PageReference List type

Click Select Page to add another list item; select More > Delete to remove a list item.

List-type-13.png

Enumerable of PageReference List type (with PropertyCollection)

Click Select Page to add another list item; select More > Delete to remove a list item.

List-type-5.png

Enumerable of Url List type

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-14.png

Guid List type

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-10.png

Inline Block List type

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-19.png

Integer List type

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-7.png

Integer (read-only) List type

List-type-20.png

LinkedItem List type

Click Add Link to add another list item; select More > Delete to remove a list item.

List-type-11.png

String List type

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-8.png

String List type (only letters)

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-21.png

String List type (10 character maximum)

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-22.png

XhtmlString List type

Click Add (+) to add another list item; select More > Delete to remove a list item.

List-type-2.png