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.
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!
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 atUmbracoViewPage
but I just want to make sure this won't cause issues later on.Very new to this so please be gentle :)
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 yourappsettings.json
for the following settings ( official Umbraco documentation here )Umbraco : ModelsBuilder : ModelsNamespace
Hopefully this help you get back on track. cheers!
is working on a reply...