Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Basic Property Types

Dave Greasley edited this page Aug 22, 2015 · 2 revisions

Definition

Most Standard Umbraco Property Editors will be generated as follows:

/// <summary>
/// The full name of the person submitting the comment
/// </summary> 		
[Required]
public string FullName { get; set; } 

Concrete will create properties using their names, not the property alias. The names will be converted to remove spaces / special characters and capitalise the first letter of each word.

If a property has been defined as Required then we add a [Required] attribute to the property in our model class. This means if we use our model classes for forms then we automatically have required field validation.

Also if you have specified a Description against a property to help content editors understand its purpose this description will be brought through as as a summary against the property on the class.

Population

The above property will be populated like so:

this.FullName = Content.GetPropertyValue<string>("fullName");

Properties are populated when the object is instantiated using the constructors that take either a content id or an IPublishedContent item.

Clone this wiki locally