Umbraco 7 is based on MVC. Why doesn't the back office call templates, views instead? Is there a difference between templates and views in Umbraco 7? Thanks,
I would try to answeryourquestionthe best Ican. Template are for your markup, bul you could also write Razor code in your templates, I am sure that you have seen this if you have played with one of the stater kits for Umbraco 7. There is a introduction video to templates in Umbraco 7.http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/introduction/
Views are using when you have a code block that want to use on more templates that one it could be navigation, news item lists and so on. And I also think that people uses views, just to get there markup clean and nice so you donĀ“t have much inline razor code in your template. Itiseasier to maintainwhenitisinview, then you just make changes in on file, and it will be on all the place where you use this views. http://our.umbraco.org/documentation/reference/Templating/Mvc/partial-views
Difference between Templates vs Views?
Umbraco 7 is based on MVC. Why doesn't the back office call templates, views instead? Is there a difference between templates and views in Umbraco 7? Thanks,
David
Hi David,
I would try to answer your question the best I can. Template are for your markup, bul you could also write Razor code in your templates, I am sure that you have seen this if you have played with one of the stater kits for Umbraco 7. There is a introduction video to templates in Umbraco 7. http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/introduction/
Views are using when you have a code block that want to use on more templates that one it could be navigation, news item lists and so on. And I also think that people uses views, just to get there markup clean and nice so you donĀ“t have much inline razor code in your template. It is easier to maintain when it is in view, then you just make changes in on file, and it will be on all the place where you use this views. http://our.umbraco.org/documentation/reference/Templating/Mvc/partial-views
To confuse you completely :) There are also Partial view macros. There are doing the same as views, and you can use the same code, that you have in your views in a paral view macro. http://stackoverflow.com/questions/2043394/what-is-the-difference-between-a-view-and-a-partialview-in-asp-net-mvc and the Umbraco documentation: http://our.umbraco.org/documentation/reference/Templating/Macros/Partial-View-Macros/
Hope this helps, if not don't hesitate to write again.
/Dennis
is working on a reply...