Upgrading to Umbraco v7.6? See here
Umbraco Package: http://our.umbraco.org/projects/developer-tools/umbraco-core-property-value-converters
Nuget Package: Install-Package Our.Umbraco.CoreValueConverters
MyGet Latest Build Package: https://www.myget.org/gallery/umbraco-core-property-value-converters
Once installed you cannot access the original raw value of the property by using Model.Content.GetPropertyValue("propertyAlias")
however you can access it by using Model.Content.GetProperty("propertyAlias").DataValue.ToString()
The v3 package for Umbraco v7.4+ currently implements converters for the following built-in Umbraco property editors:
- Content Picker - returns
IPublishedContent
- Media Picker - returns
IPublishedContent
- Multiple Media Picker - returns
IEnumerable<IPublishedContent> or IPublishedContent
- MultiNodeTreePicker - returns
IEnumerable<IPublishedContent>
- Related Links - returns
RelatedLinks
These converters work with both the typed IPublishedContent (Model.Content) and also the dynamic DynamicPublishedContent (CurrentPage). We use some dark magic (StackTrace) to make sure we return the correct model. However if you only use one model you can specify this by adding a optional key to app settings of your web.config, this will avoid the dark magic and therefore improve performance. The optional setting is as follows:
<add key="Our.Umbraco.CoreValueConverters:Mode" value="typed" />
<add key="Our.Umbraco.CoreValueConverters:Mode" value="dynamic" />
v3 works brilliantly with the Umbraco ModelsBuilder that is included with Umbraco v7.4+. More information on this can be found here
If you're upgrading a website using this package to Umbraco v7.6 it is recommend that you un-install this package before you upgrade, this is because the package has been included in Umbraco v7.6 Core. Additionally it should be noted that this package does not currently convert the "v2" pickers such as "Umbraco.ContentPicker2" so any new pickers will not be converted to objects unless EnablePropertyValueConverters
is enabled.
Steps are:
- Un-install the
CoreValueConverters
NuGet Package - Upgrade Umbraco to v7.6+
- Enable the
EnablePropertyValueConverters
setting in theContent
element ofumbracoSettings.config
- If you are using the Models Builder you will need to regenerate your Models
- If you are using the
RelatedLinks
model it has changed namespace toUmbraco.Web.Models
so you may need to update the namespace in the/Views/Web.config
and any other code that has referencedRelatedLinks
This project is MIT licensed