Master of Datatypes, Umbraco Be Festival

Post on 21-May-2015

19.233 views 1 download

Tags:

description

Slides from session at Umbraco BE festival, In this session we'll take a look at the datatype improvements introduced in v 4.6 and 4.7 of Umbraco.By taking advantage of the data editor settings creating configurable datatypes is a breeze.Combine that with the usercontrol wrapper and xml data storage and you'll be able to create complex and versatile custom datatypes in minutes.

Transcript of Master of Datatypes, Umbraco Be Festival

Master of

Datatypes

Master ofDatatypes• Tim Geyssens

• Live in Belgium work for Umbraco• Core Work• Umbraco.tv episodes• Training• Support• Blog at Nibble.be

Master ofDatatypes

Datatypes ?

Master ofDatatypes

• Extendable (create your own)• More diffucult things to extend

Datatypes

Master ofDatatypes

• Session goal• Rich & Configurable• Take advantage of the tools = easy

Datatypes

Master ofDatatypes

• UsercontrolWrapper• Data Editor Settings• Xml Serialization• Razor

Tools

Master ofDatatypes

• These tools make it really, really easy• (so might be a short session)• Altough I’ll be creating 3 datatypes

Warning

Master ofDatatypes

UserControlWrapper

Master ofDatatypes

• Any Usercontrol as datatype• Implement interface• IUsercontrolDataEditor• Single Member• Property Value (type object)

UC Wrapper

Master ofDatatypes

Datatype #1

Master ofDatatypes

Data Editor Settings

Master ofDatatypes

• Add settings to your datatype• More flexibility, reuse options• Super Easy• Mark public properties with data editor

settings attribute

Data Editor Settings

Master ofDatatypes

Datatype #2

Master ofDatatypes

• Not limited to textbox• 21 types out of the box• Extend with your own types

Data Editor Settings

Master ofDatatypes

XML Serialization

Master ofDatatypes

• Store rich data (not a single value)• Xml properties (related links)• UC Wrapper return xml string• Custom to xml code or• Serialize your object

XML Serialization

Master ofDatatypes

• Not familiar with serialization• 2 Helper Methods• SerializationHelper– ValueToXmlString(object value)– ValueFromXmlString(object value, Type type)

XML Serialization

Master ofDatatypes

Datatype #3

Master ofDatatypes

Razor

Master ofDatatypes

• Outputting our XML Property• Easy with razor• .notation• Note that the root node is removed

Razor

Master ofDatatypes

Questions ?

Master of

Datatypes