Copied to clipboard

Flag this post as spam?

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


  • Vijay 26 posts 127 karma points
    Mar 04, 2019 @ 14:15
    Vijay
    0

    How can I get documenttype Content in Razor html?

    Here is my Razor html code,

    @inherits Umbraco.Web.Mvc.UmbracoViewPage

    @using ContentModels = Umbraco.Web.PublishedModels;

    @{ var home = Model; Layout = null; }

  • Rhys Hamilton 140 posts 942 karma points
    Mar 04, 2019 @ 16:38
    Rhys Hamilton
    1

    Hi Vijay,

    You might find the documentation on rendering content for V8 useful.

    However, briefly, something like the following should work (where prop is the name of your property (e.g - pageTitle, pageText etc):

    @Model.Value("prop")
    

    Or if you're using the ModelsBuilder:

    @Model.Prop
    
Please Sign in or register to post replies

Write your reply to:

Draft