Copied to clipboard

Flag this post as spam?

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


  • David Knight 1 post 71 karma points
    9 hours ago
    David Knight
    0

    Can't set content model

    Hi.

    I'm taking the Fundamentals course, and at the point where I start to add HTML, the video shows the code with the content model section autopopulated in line 2: @inherits Umbraco.CMS.Web.Common.Views.UmbracoViewPage<ContentModels.HomePage> I've tried using camel case, but still get the same error: 'Content Models' could not be found. The page displays OK when line 2 ends at UmbracoViewPage but I just want to make sure this won't cause issues later on.

    Very new to this so please be gentle :)

  • Damian 76 posts 399 karma points
    4 hours ago
    Damian
    0

    Hi David, Welcome!

    Typically there is an auto-generated line right underneath the @inherits… line which looks something like: @using ContentModels = ProjectNameHere.Web.PublishedModels;

    This makes ContentModels an alias for whatever your generated models are namespaced. You can check this by reviewing your appsettings.json for the following settings ( official Umbraco documentation here ) Umbraco : ModelsBuilder : ModelsNamespace

    Hopefully this help you get back on track. cheers!

Please Sign in or register to post replies

Write your reply to:

Draft