SlideShare une entreprise Scribd logo
1  sur  8
What the heck is a Umbraco property
      editor value converter?




      Jeavon Leopold - Twitter: @crumpled_jeavon
      e: jeavon@crumpled-dog.com www.crumpled-dog.com
What the heck?
     What is a data type property editor?
     • Property editors are the actual editors that are rendered to the content editors, implemented using
       AbstractDataEditor or IUsercontrolDataEditor
     • Data types (stored in DB) implement a selected property editor (coded in C#)
     • Content values are stored as a string in prevalue(s) (often as CSV, Json or XML)




     So what is a property editor value converter?
     • Introduced in Umbraco v4.10
     • Applies to MVC razor rendering only
       (there is a similar mechanism for razor macros called Razor Model Binding)
     • Converts the stored content value string to some other type e.g IPublishedContent
     • Can be included with a property editor (especially if property editor is a package)




10/04/2013                                                                                                   You are on page 2
How is this useful?
     How many times have you had to split in Razor to use MNTP?
     • My version for Razor Macros:




     • In MVC (using dynamics), a little better, maybe 




10/04/2013                                                        You are on page 3
How is this useful?
     • In MVC (typed), definitely no better 




                                                         Pretty complicated for a front end developer
                                                         trying to do some basic Razor templating?


     With a property editor value converter implemented on MNTP (using dynamics)
     Definitely better 




                                                         Complicated now?


     •       Doesn’t matter if XML or CSV storage type used by MNTP, the converter takes care of it
     •       Implemented in both Typed and Dynamics




10/04/2013                                                                                              You are on page 4
How to implement a converter?
      Implement IPropertyEditorValueConverter
      • Found in Umbraco.Core.PropertyEditors namespace
      • Two methods: IsConverterFor & ConvertPropertyValue
      • Use UmbracoHelper if it helps
      Example converter for Content Picker




10/04/2013                                                   You are on page 5
Quick demo
      •   Fresh Umbraco v6.0.3 using NuGet
      •   Install Standard Website MVC
      •   Build MNTP Property editor value converter
      •   Copy dll into solution
      •   Update the Razor slideshow




10/04/2013                                             You are on page 6
More?
     Umbraco Core Property Editor Converter Package (Umbraco v6 only)
     •  Implements converters for Umbraco Core property editors
     •  Will hopefully be merged in Umbraco pre v7
     •  http://our.umbraco.org/projects/developer-tools/umbraco-core-property-editor-converters
     •  Check out the source code https://bitbucket.org/jeavon/umbraco-core-property-editor-converters
     •  Helper method WIP – provides access to the data type settings so that you can alter the return type
        depending on the settings

     Documentation
     •   http://our.umbraco.org/documentation/Extending-Umbraco/Property-
         Editors/PropertyEditorValueConverters




10/04/2013                                                                                                    You are on page 7
Thank you.




Crumpled Dog Design - 18 Phipp St, London EC2A 4NU
020 7739 5553 | jeavon@crumpled-dog.com | www.crumpled-dog.com

Contenu connexe

Tendances (7)

Node.js primer
Node.js primerNode.js primer
Node.js primer
 
WSO2 Gateway
WSO2 GatewayWSO2 Gateway
WSO2 Gateway
 
Training Slides: 206 - Using the Tungsten Cluster AMI
Training Slides: 206 - Using the Tungsten Cluster AMITraining Slides: 206 - Using the Tungsten Cluster AMI
Training Slides: 206 - Using the Tungsten Cluster AMI
 
Web assembly overview by Mikhail Sorokovsky
Web assembly overview by Mikhail SorokovskyWeb assembly overview by Mikhail Sorokovsky
Web assembly overview by Mikhail Sorokovsky
 
Web assembly - Future of the Web
Web assembly - Future of the WebWeb assembly - Future of the Web
Web assembly - Future of the Web
 
Actors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, GigyaActors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, Gigya
 
Art Of Message Queues
Art Of Message QueuesArt Of Message Queues
Art Of Message Queues
 

En vedette (6)

enlight logo
enlight logoenlight logo
enlight logo
 
BestCamp camping belgië
BestCamp camping belgiëBestCamp camping belgië
BestCamp camping belgië
 
Grape Digital Trends Newsletter 2
Grape Digital Trends Newsletter 2Grape Digital Trends Newsletter 2
Grape Digital Trends Newsletter 2
 
презентация студии тропинка
презентация студии тропинкапрезентация студии тропинка
презентация студии тропинка
 
2 берега 5 культур
2 берега  5 культур2 берега  5 культур
2 берега 5 культур
 
Бесплатное продвижение сайта
Бесплатное продвижение сайтаБесплатное продвижение сайта
Бесплатное продвижение сайта
 

Similaire à What the heck is a Umbraco property editor value converter?

ITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interopITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp
 
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
Jessica Tai
 
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
Jeavon Leopold
 
Silverlight converters
Silverlight convertersSilverlight converters
Silverlight converters
msarangam
 

Similaire à What the heck is a Umbraco property editor value converter? (20)

Umbraco OktoberFest 2014
Umbraco OktoberFest 2014Umbraco OktoberFest 2014
Umbraco OktoberFest 2014
 
ITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interopITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interop
 
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
 
Babel.pptx
Babel.pptxBabel.pptx
Babel.pptx
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
 
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
 
Angular Ivy- An Overview
Angular Ivy- An OverviewAngular Ivy- An Overview
Angular Ivy- An Overview
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)
 
React js
React jsReact js
React js
 
ReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOMReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOM
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
Ember.js: Jump Start
Ember.js: Jump Start Ember.js: Jump Start
Ember.js: Jump Start
 
Silverlight converters
Silverlight convertersSilverlight converters
Silverlight converters
 
Apache Drill (ver. 0.2)
Apache Drill (ver. 0.2)Apache Drill (ver. 0.2)
Apache Drill (ver. 0.2)
 
Microservices Architecture and Containers.
Microservices Architecture and Containers.Microservices Architecture and Containers.
Microservices Architecture and Containers.
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
Nodejs
NodejsNodejs
Nodejs
 
Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

What the heck is a Umbraco property editor value converter?

  • 1. What the heck is a Umbraco property editor value converter? Jeavon Leopold - Twitter: @crumpled_jeavon e: jeavon@crumpled-dog.com www.crumpled-dog.com
  • 2. What the heck? What is a data type property editor? • Property editors are the actual editors that are rendered to the content editors, implemented using AbstractDataEditor or IUsercontrolDataEditor • Data types (stored in DB) implement a selected property editor (coded in C#) • Content values are stored as a string in prevalue(s) (often as CSV, Json or XML) So what is a property editor value converter? • Introduced in Umbraco v4.10 • Applies to MVC razor rendering only (there is a similar mechanism for razor macros called Razor Model Binding) • Converts the stored content value string to some other type e.g IPublishedContent • Can be included with a property editor (especially if property editor is a package) 10/04/2013 You are on page 2
  • 3. How is this useful? How many times have you had to split in Razor to use MNTP? • My version for Razor Macros: • In MVC (using dynamics), a little better, maybe  10/04/2013 You are on page 3
  • 4. How is this useful? • In MVC (typed), definitely no better  Pretty complicated for a front end developer trying to do some basic Razor templating? With a property editor value converter implemented on MNTP (using dynamics) Definitely better  Complicated now? • Doesn’t matter if XML or CSV storage type used by MNTP, the converter takes care of it • Implemented in both Typed and Dynamics 10/04/2013 You are on page 4
  • 5. How to implement a converter? Implement IPropertyEditorValueConverter • Found in Umbraco.Core.PropertyEditors namespace • Two methods: IsConverterFor & ConvertPropertyValue • Use UmbracoHelper if it helps Example converter for Content Picker 10/04/2013 You are on page 5
  • 6. Quick demo • Fresh Umbraco v6.0.3 using NuGet • Install Standard Website MVC • Build MNTP Property editor value converter • Copy dll into solution • Update the Razor slideshow 10/04/2013 You are on page 6
  • 7. More? Umbraco Core Property Editor Converter Package (Umbraco v6 only) • Implements converters for Umbraco Core property editors • Will hopefully be merged in Umbraco pre v7 • http://our.umbraco.org/projects/developer-tools/umbraco-core-property-editor-converters • Check out the source code https://bitbucket.org/jeavon/umbraco-core-property-editor-converters • Helper method WIP – provides access to the data type settings so that you can alter the return type depending on the settings Documentation • http://our.umbraco.org/documentation/Extending-Umbraco/Property- Editors/PropertyEditorValueConverters 10/04/2013 You are on page 7
  • 8. Thank you. Crumpled Dog Design - 18 Phipp St, London EC2A 4NU 020 7739 5553 | jeavon@crumpled-dog.com | www.crumpled-dog.com