50 votes

Umbraco Core Property Value Converters

This package implements property editor converters for the Umbraco Core property editors. 

v3 Package is for Umbraco v7.4.2+ & v7.5

Nuget Package: Install-Package Our.Umbraco.CoreValueConverters

v2 Package is for Umbraco v7.1, v7.2 and v7.3

v1.1 Package is for Umbraco v6.2
Nuget Package: Install-Package Our.Umbraco.CoreValueConverters -Version 1.1.0

These property editor converters mean that using data types (based on core property editors) with Razor in MVC Views is much easier as the data is returned as collections or other objects rather than strings that require splitting etc. Additionally in Visual Studio you get IntelliSense (for typed) when accessing your content properties.

Most of the implemented converters in the v1 package were developed during a day at the Umbraco v6 hackathon in London :-) I would love for others to contribute to this project to improve & optimise the converters, I'm sure a lot could be improved! In particular I would love some feedback/suggestions on how to deal with Custom objects, such as the one implemented for the “Related Links” property editor.

Please note that this project is a beta and as such breaking changes may be introduced before it is fully released.

Online v3 documentation here There are examples here for each of the currently implemented editors.

Documentation for working with v3 & Umbraco ModelsBuilder can be found here

The v3 package for Umbraco v7.4+ currently implements converters for the following built-in Umbraco property editors:

The v1 package for Umbraco v6 currently implements converters for the following built-in Umbraco property editors:

  • MNTP - returns IEnumerable<IPublishedContent>
  • Ultimate Picker - returns IEnumerable<IPublishedContent> if Data Type setting "Type" is set to a multi node selector (e.g. CheckBoxList) or returns IPublishedContent if Data Type setting "Type" is set to a single node selector (e.g. DropDownList)
  • XPath CheckBoxList - returns IEnumerable<IPublishedContent> (except if member, values setting should be set to "Node Ids"
  • XPath DropDownList - returns IPublishedContent (except if member, value setting should be set to "Node Id")
  • Content Picker - returns IPublishedContent
  • Media Picker - returns IPublishedContent
  • Related Links - returns RelatedLinksList
  • Multiple Textstring - returns List<string>
Change Log:
  • 1.0.3-beta - Ultimate Picker return type dependant on "Type" setting
  • 1.0.4-beta - Add Multiple Textstring converter and Content Picker converter now ignores umbracoInternalRedirectId
  • 2.0.0-beta - Umbraco v7 support
  • 2.0.1-beta - Related links now returns IEnumerable and RelatedLinks moved to Models namespace (breaking change)
  • 2.0.2-beta - Corrected Namespace to Our.Umbraco.PropertyConverters (breaking change for RelatedLinks)
  • 2.0.3-beta - Fix for Content Picker so that it works with Archetype (Archetype doesn't pass in PropertyTypeAlias)
  • 2.0.4 - Added umbracoRedirect to properties to not convert & automatically add/remove namespace to Razor web.config on install/uninstall
  • 2.0.5 - Fixed usage with dynamics (CurrentPage), also added optional AppSetting to fix mode to dynamic or typed to optimise performance if needed
  • 2.1.0 (requires Umbraco v7.1.5) - Added support for Members in Multinode tree picker, implemented IPropertyValueConverterMeta and correctly implemented both ConvertDataToSource and ConvertSourceToObject where applicable
  • 2.1.1 - Added a check to skip links in the RelatedLinks if they are internal and deleted or unpublished
  • 2.1.2 - Fix mistake in RelatedLinks skip logging
  • 2.1.3 - Fix for issue #1 - Umbraco Core method EntityService.GetObjectType throws when item has been deleted
  • 2.1.4 -  Fix for issue #4 - MNTP should return a DynamicPublishedContentList when used with dynamics
  • 2.1.5 - MNTP converter now doesn't use EntityService so avoids any DB queries! Many thanks to Kenn Jacobsen for the pull request!
  • 3.0.0 - (requires Umbraco v7.4.2+) better support for Umbraco ModelsBuilder as converters can now be inherited from for "special" models
  • 3.1.0 - refactored RelatedLinks, improved performance of Multiple Media Picker and added support for using Multinode picker with Umbraco redirect
  • 3.1.1 - fix a issue where new installs cannot find the multiple media picker prevalues

Screenshots

Archived files

Documentation

Source code

 Download package
version 3.1.2

NuGet install instructions for Umbraco 7.2.0-7.5.0

Install-Package Our.Umbraco.CoreValueConverters

Package owner

Jeavon Leopold

Jeavon Leopold

Jeavon has 13632 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Works on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions: 7.6.x, 7.5.x, 7.4.x, 7.3.x, 7.2.x, 7.1.x, 7.0.x

Package Information

  • Package owner: Jeavon Leopold
  • Contributors: Hendy Racher , Lee Kelleher , Tom Fulton
  • Created: 11/03/2013
  • Current version 3.1.2
  • .NET version 4.0,4.5
  • License MIT
  • Downloads on Our: 14.3K
  • Downloads on NuGet: 189.2K
  • Total downloads : 203.5K

External resources