Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • DaveC 8 posts 28 karma points
    Sep 21, 2014 @ 07:46
    DaveC
    0

    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

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 21, 2014 @ 11:40
    Dennis Aaen
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies