Loading...
Area: Optimizely CMS
ARCHIVED This content is retired and no longer maintained. See the latest version here.

Recommended reading 

EPiServer content is built-up by models with properties that store and present data. You can use many built-in property types in your models and also create your own property types.

Common property types

What you want to create

Solution

Editing experience

Hints and tips

Plain short text

String property

One row input

Control the allowed length with the StringLength attribute. Use custom tag to control the containing tag, such as using a H1 for the main header for the page. 

Plain long text

String property with UIHint.Textarea

Text area

Control the allowed length with the StringLength attribute.

Html

XHtmlString property

A TinyMCE HTML editor

 

Integer value

Int property

A number slider

Controls other rendering, such as the number of items in a list. Control the min and max values with the Range attribute.

Date and time

DateTime property

A date and time picker

Control the min and max values with the Range attribute.

Double

Double property

Check editor

Control the min and max values with the Range attribute.

Boolean

Boolean property

Check box

 

Page type

PageType property

 

Filter items in a list, and so on.

Form

XForm property

A form created by an editor

Render a form that was created by an editor.

 

BLOB

 

 

Hold binary data (such as an image). Route to a BLOB with pattern <Url to content>/BlobPropertyName.

Working with other content

To refer to existing content, use the Link or LinkCollection to create internal or external links.

  • Use Content area to display content from other content.
  • Use ContentReference, ContentReferenceList (new from version EPiServer.CMS.UI 8.6.0), or URL to link to a single content of a specified type.
  • Use the AllowedTypes attribute to further restrict the kind of links that are possible to add to a property, (although there are a few known limitations).

Use a content reference with many different UI hints to select different entities in EPiServer, such as a block, a media item, a block folder, a media folder, and so on. 

What you want to create

Solution

Editing experience

Hints and tips

Link to a page

PageReference property

Content picker with
drag and drop support

 

Link to a media file of any type

ContentReference property
with UIHint.MediaFile

Content picker with
drag and drop support

Link to any file in the media repository. Use ContentReference instead to use standard content rendering. (Mostly for backwards compatibility.) 

Link to an image

ContentReference property
with UIHint.Image

Content picker with
drag and drop support

Lets an editor select content in the media repository by implementing IContentImage.

Link to a video

ContentReference property
with UIHint.Video

Content picker with
drag and drop support

Lets an editor select content in the media repository by implementing IContentVideo.

Link to a media file with the possibility to append information in the URL

Url property with
UIHint.MediaFile or
UIHint.Image or
UIHint.Video

Content picker with
drag and drop support

Each link can be an item inside EPiServer, such as pages or media but also external URLs. Use URL instead of ContentReference if you want to add information, such as query string parameters to control size.

Content area

ContentArea property

   

URL

Url property

Link dialog with drag and drop support

 

Link to multiple external and/or internal resources

LinkItemCollection 
property

Link collection editor with drag and drop support

Does not support AllowedTypesAttribute.

Link to multiple internal pages, media file or other content type.

ContentReferenceList property

Content picker with
drag and drop support

Supports AllowedTypesAttribute.

Selecting predefined values

You can use the following solutions to create dropdown lists and checkbox lists:

What you want to do

Solution

Editing experience

Hints and tips

Select a single item from a relatively short list of options

String/Int property with SelectOne attribute

Link to implementation
page

 

Select several items from a relatively short list of options

String/Int property with SelectMany attribute

Link to implementation
page

 

Select a single item from a relatively long list of options

String/Int property with AutoSuggestion attribute

Link to implementation
page

Use with caution because the auto-suggestion editor creates requests to the server.

Validation attributes

EPiServer supports the following validation attributes that are part of the .NET Framework:

  • Range
  • StringLength
  • RegularExpression
  • EmailAttribute

You can create custom attributes that implement either ValidationAttribute or IMetadataAware. See Restricting access to who is allowed to edit a property.

Related topics

Do you find this information helpful? Please log in to provide feedback.

Last updated: Feb 23, 2015

Recommended reading