I've created a document type "Test" with only one property "multinodetreepicker", which is (obviously) a multi node tree picker, configured to select content with no further filters or limitations.
The following code returns the PublishedPropertyType of the property:
var itemType = PublishedContentType.Get(PublishedItemType.Content, "Test");
var propertyType = itemType.GetPropertyType("multinodetreepicker");
Only... the ClrType property of the PublishedPropertyType is reported as being IPublishedContent - I would have thought it'd be IEnumerable<IPublishedContent>?
This messes with the ModelsBuilder package, because it translates the document type property to an IPublishedContent property instead of IEnumerable<IPublishedContent>. Can anything be done to fix this?
You need the value converters v2.1.0 to use with IPublishedContentModelFactory and Model Builder or Ditto. This does require Umbraco v7.1.5 (or v7.1.6).
You're welcome, also when your using strongly typed models you should set the web.config mode appsetting for a mini performance boost (of course you can't then use CurrentPage). Details at the bottom of this page
MNTP reports wrong ClrType via PublishedPropertyType
Package version 2.0.5, Umbraco version 7.1.4
I've created a document type "Test" with only one property "multinodetreepicker", which is (obviously) a multi node tree picker, configured to select content with no further filters or limitations.
The following code returns the
PublishedPropertyType
of the property:Only... the
ClrType
property of thePublishedPropertyType
is reported as beingIPublishedContent
- I would have thought it'd beIEnumerable<IPublishedContent>
?This messes with the ModelsBuilder package, because it translates the document type property to an
IPublishedContent
property instead ofIEnumerable<IPublishedContent>
. Can anything be done to fix this?-Kenn
Hi Kenn,
You need the value converters v2.1.0 to use with IPublishedContentModelFactory and Model Builder or Ditto. This does require Umbraco v7.1.5 (or v7.1.6).
Jeavon
Excellent! It works in 2.1.0 :) thank you.
You're welcome, also when your using strongly typed models you should set the web.config mode appsetting for a mini performance boost (of course you can't then use CurrentPage). Details at the bottom of this page
is working on a reply...