Copied to clipboard

Flag this post as spam?

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


  • Bob 38 posts 160 karma points
    Mar 09, 2017 @ 22:52
    Bob
    0

    Create masterpage

    I'm new with mvc so reading a few tutorials around.

    I created a new Visual Studio project (2015) and installed Umbraco 7.5., ran the setup wizard and configured the project successfully.

    I want to create my first master page, so instead of using the browser and adding into Templates I instead expanded the views folder in VS2015 and was presented with

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage

    Can I delete this and replace it with html markup or is there some syntax I need to learn to add standard html into this area?

    Sorry new with this, so any guidance is great

  • Martin Almström 33 posts 159 karma points
    Mar 10, 2017 @ 10:17
    Martin Almström
    0

    Hi Bob,

    You can read up on how to use layout pages from the MVC documentation. Umbraco use normal MVC.

    https://docs.microsoft.com/en-us/aspnet/core/mvc/views/layout

    In short:

    Create _ViewStart.cshtml in ~/Views that tells all underlaying views to use that code. Add code

    @{ Layout = "~/Views/Layouts/Master.cshtml"; }
    

    Create the Master.cshtml in ~/Views/Layouts/

    Follow that MVC guideline on how to populate the master.cshtml.

    Hope that helps. Martin

  • 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