Episerver Properties A Quick Reference

Following up on my Episerver : PageTypeBuilder Reference Cheat Sheet where I discussed in some length about the various type of attributes and properties you can decorate a page type with.

In today’s article, we are going to discuss the attributes, back types and properties you can put on the members of your page type definitions.

Backing Type Resolver

For each property in your page type definition, you will need to map it to an underlying Episerver property.  This means when a content editor views the page properties on the editor, the correct display, for example a PropertyInt, will restrict editors to be only allowed to add numbers.

The BackingTypeResolver will map your page types property definition (think int, string ContentArea) into the types of what PropertyData type should be used.

Type Backing type used
bool PropertyBoolean
byte PropertyNumber
ContentArea PropertyContentArea
CategoryList PropertyCategory
ContentReference PropertyContentReference
DateTime PropertyDate
decinal/double/float PropertyFloatNumber
Int PropertyNumber
LinkItemCollection PropertyLinkCollection
PageReference PropertyPageReference
PageType PropertyPageType
single PropertyFloatNumber
string PropertyLongString
TimeSpan PropertyTimeSpan
Url PropertyUrl
XForm PropertyXForm
XhtmlString PropertyXhtmlString

An example of how a Properties backing type definition works can be seen below:

[BackingType(typeof(PropertyInt))]
[Display( Name = "Example Property",
Description = "Example Property",
GroupName = SystemTabNames.Content,
Order = 10)]
public virtual int ExampleProperty{ get; set; }

Episerver Attributes

BackingType() Defines which PropertyData type Episerver should used in the editor. You can create your own custom properties but it must inherit from PropertyData.
CultureSpecific If set, then a content editor will be able to enter different text for different languages.  If it’s not set, everything will default to the main language.
<Display Name, Description, GroupName, Order
Ignore Tell Epi to irgnore the property in the CMS, useful if you’re posting forms and need somewhere to store your data on post back.
Range[x,x] If this is set on an int, limits the range of numbers that can be added
RegularExpression If this is set on a string, you can enforce the string to match the Regex before it can be saved.
Required Has to have a value before the page can be saved.
ScaffoldColumnAttribute Is the property visible in Edit mode.
Searchable If this type, searchable in Find.
StringLength If set on a string, determines the max length of the characters a use can enter.
UIHint UI hints are used to make the MVC helper methods use a specific display template when rendering properties.

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

More Posts

1 reply

Trackbacks & Pingbacks

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *