Closed ptilsed closed 5 years ago
This is awesome @ptilsed , thanks a million! I wish there was a way to get around setting our version as InitialPublishedContent (and there probably is), but that can be improved on later I think - enabling ModelsBuilder support is a major enhancement.
@ondrejpialek I had a look at a few other options but this one seemed to be the best fit with the way Umbraco currently works. I couldn't see any obvious issues with doing it this way but of cause it's not really the way that property is supposed to be used so if there is a better place to put it that would be great.
We have this same problem, are you going to release this fix?
Sorry guys! Will get this out onto NuGet soon! ⌛️
Hi,
This fixes an issue I came across when trying out uSplit. The issue was the custom model uSplit uses seems incompatible with custom models produced by the Model Builder or mapped on custom controllers.
In order to fix this, I have adapted the pipeline to use the current PublishedContentModelFactoryResolver to map the variant to any custom model that is associated top the content type. The variant view model is then associated too the InitialPublishedContent in order to allow the HTML helpers to pick up the correct scripts.
This seems to fix the problem on a simple test site so hopefully, it will be found useful.
Cheers,
Paul