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
    Jan 17, 2025 @ 10:31
    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 77 posts 400 karma points
    Jan 17, 2025 @ 15:39
    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!

  • 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