SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente (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
 

Destacado (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 культур
 
Бесплатное продвижение сайта
Бесплатное продвижение сайтаБесплатное продвижение сайта
Бесплатное продвижение сайта
 

Similar a 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
 

Similar a 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)
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

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...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
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...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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, ...
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

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