-
Notifications
You must be signed in to change notification settings - Fork 0
Basic Property Types
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.
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.