We have moved to GitHub Issues
Created by Shannon Deminick 23 Oct 2013, 22:17:41 Updated by Stephan 06 Mar 2014, 07:23:56
This is a continuation from this discussion here: http://our.umbraco.org/projects/developer-tools/umbraco-codegen/development-discussion/45586-2013-10-20-Road-ahead
Essentially this will solve the following problems/features:
To do this should be quite easy:
This gives us some pretty huge flexibility with UmbracoViewPage
Have a prototype running for that one... stay tuned...
Have it working, now documenting, will push (hopefully) tomorrow.
Pushing commit onto 6.2.0 soon. So now you can use any of these:
@inherit UmbracoViewPage :: Model is IPublishedContent
Looks like we don't need type converters, UmbracoViewPage does all the conversions between IPublishedContent, strongly-typed content, RenderModel, etc... by itself. With that in place, I don't see why anybody would still use UmbracoTemplatePage but it's there for backward compatibility. I assume that with this in place, every template or partial view is going to inherit from UmbracoViewPage one way or another.
When doing @Html.Partial(...) you can pass pretty much anything as a model, ie an IPublishedContent, a strongly-yped content, a RenderModel... and the view will re-map that to the expected model, provided it is possible of course.
If you change the view type in Web.config to UmbracoViewPage, all you need to do is one of these:
@model IPublishedContent @model MyContentType @model MyModel
NOTE: if you don't indicate neither @inherits nor @model then the view will be of type WebViewPage
When inheriting from UmbracoViewPage
It should be all backward-compatible. It works with the default controller which is unchanged. Can ppl review the code, and comment?
NOTE: I'd like things to be as simple with partial view macros... will look into how they work soon as I have some time.
And that would be commit 128a08f.
Looks pretty awesome to me!
Looks great. Sorry I haven't been able to give it a whirl yet. Hope to squeeze in time real soon. Will let you know. I'm sure it'll be a breeze.
This stuff looks pretty solid now, can't wait to try this out properly in an actual release!
Stephen, can you mark this as fixed if it is complete?
Status: looks OK to me, using it on a 6.2 website and it works as intended. Closing.
Backwards Compatible: True
Due in version: 7.1.0, 6.2.0