I'm new to Umbraco and trying to figure out how everything works.. I want to use MVC and Umbraco 7, and I want to define as much as possible in code. I realize Umbraco 7 is pretty fresh, and I can't seem to find any good tutorials covering MVC and Umbraco 7.
Can anyone point me to some good tutorials? I prefer written tutorials, I don't have the patience to watch movies
Thank you, excellent links :) I assume these still apply for Umbraco 7.0..
Is it possible to define a document type in code? And use this as a strongly typed model in my views? In the documentation it states that @Model is always of type Umbraco.Web.Mvc.RenderModel (with property Content of type IPublishedContent). Can I define a model/viewmodel/document type "Article", and pass this into @Model in my views? I don't want to rely on "magic strings" @Model.Content.GetPropertyValue("bodyContent"), but want strongly typed models (@Model.BodyContent).
Is it normal not to implement any controllers in an Umbraco MVC project?
Umbraco doesn't have native code first support nor does it directly create strongly typed models, however you can create your own strongly typed models using a controller and route hijacking along with your strongly typed models of your document types. There are many other approaches, I really like the factory idea in this blog post Also read this recent post about the state of code first in Umbraco.
I should say, that not all property editors are the same between v6 and v7 as in v7 they have been converted to AngularJs and the complex editors now store as JSON as previously they may have stored as XML, for example see this post about related links
Really only uSiteBuilder provides Code First for Umbraco.
I believe that the latest build of uSiteBulder from source (May 23rd 2013) works very well with v6.
You may also be interested in the current discussion about uSiteBuilder2 which is planned to support Umbraco v7 and also the thoughts from Stephen about what the Core might do to make things easier very soon.
Pointer to good tutorials?
I'm new to Umbraco and trying to figure out how everything works.. I want to use MVC and Umbraco 7, and I want to define as much as possible in code. I realize Umbraco 7 is pretty fresh, and I can't seem to find any good tutorials covering MVC and Umbraco 7.
Can anyone point me to some good tutorials? I prefer written tutorials, I don't have the patience to watch movies
Are there any sample-solutions out there?
-Thomas
Hi Thomas,
Since you want to use MVC I would recommend to look here: Mvc templating and Built-in Property Editors
Even if you're not much for video tutorials I will still recommend to take a look on Umbraco TV umbraco.tv
Hope this is, what you was looking for.
/Dennis
Thank you, excellent links :) I assume these still apply for Umbraco 7.0..
Is it possible to define a document type in code? And use this as a strongly typed model in my views? In the documentation it states that @Model is always of type Umbraco.Web.Mvc.RenderModel (with property Content of type IPublishedContent). Can I define a model/viewmodel/document type "Article", and pass this into @Model in my views? I don't want to rely on "magic strings" @Model.Content.GetPropertyValue("bodyContent"), but want strongly typed models (@Model.BodyContent).
Is it normal not to implement any controllers in an Umbraco MVC project?
Hi Thomas,
Yes, MVC is the same in Umbraco v7 as in v6.
Umbraco doesn't have native code first support nor does it directly create strongly typed models, however you can create your own strongly typed models using a controller and route hijacking along with your strongly typed models of your document types. There are many other approaches, I really like the factory idea in this blog post Also read this recent post about the state of code first in Umbraco.
It is very normal to have both Surface Controllers and Custom Controllers in an Umbraco project.
Jeavon
I should say, that not all property editors are the same between v6 and v7 as in v7 they have been converted to AngularJs and the complex editors now store as JSON as previously they may have stored as XML, for example see this post about related links
Ok, so if I want to use code first and strongly typed models I have the following options:
Really only uSiteBuilder provides Code First for Umbraco.
I believe that the latest build of uSiteBulder from source (May 23rd 2013) works very well with v6.
You may also be interested in the current discussion about uSiteBuilder2 which is planned to support Umbraco v7 and also the thoughts from Stephen about what the Core might do to make things easier very soon.
Comment author was deleted
Plenty of info on http://www.nibble.be/ ;)
Sounds like this one would be interesting for you http://www.nibble.be/?p=337 (property value converters for intellisense in vs)
is working on a reply...