This repository was archived by the owner on Jun 18, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/Our.Umbraco.NestedContent/Extensions Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,23 @@ public static object ConvertPropertyToNestedContent(this PublishedPropertyType p
93
93
var pcr = UmbracoContext . Current . PublishedContentRequest ;
94
94
var containerNode = pcr != null && pcr . HasPublishedContent ? pcr . PublishedContent : null ;
95
95
96
- processedValue . Add ( new DetachedPublishedContent (
96
+ // Create the model based on our implementation of IPublishedContent
97
+ IPublishedContent content = new DetachedPublishedContent (
97
98
nameObj == null ? null : nameObj . ToString ( ) ,
98
99
publishedContentType ,
99
100
properties . ToArray ( ) ,
100
101
containerNode ,
101
102
i ,
102
- preview ) ) ;
103
+ preview ) ;
104
+
105
+ if ( PublishedContentModelFactoryResolver . HasCurrent )
106
+ {
107
+ // Let the current model factory create a typed model to wrap our model
108
+ content = PublishedContentModelFactoryResolver . Current . Factory . CreateModel ( content ) ;
109
+ }
110
+
111
+ // Add the (typed) model as a result
112
+ processedValue . Add ( content ) ;
103
113
}
104
114
105
115
if ( propertyType . IsSingleNestedContentProperty ( ) )
You can’t perform that action at this time.
0 commit comments