Umbraco not finding my HomePage.cshtml file (No ph...
# help-with-umbraco
z
I am setting up my first personal Umbraco project after having worked a bit with it a couple of years ago, and as I'd rather code in an IDE locally as opposed to through templates, I am trying to connect my HomePage.cshtml file to my "homePage" document type. However, I get a "No physical template file was found for document type with alias homePage" no matter what I try. Any tips? Umbraco 12
s
In the umbraco backoffice, did you add the template to the document type? If so, you can always check in the content part if there is a template.
z
Oh I assumed adding a template was exclusively for manually editing the code in the backoffice. 😮
You were completely correct, that was the remaining step. Got a hit!
s
nice one, have fun developing!
(ps, if you create a document type that you want to have a view attached, chosse the document type with template option. That way the view is already coupled and you can open the generated cshtml in you local IDE)
z
Oh the cshtml is then generated, nice
Any other sweet tips? I want to create something componentable, so I am curious if I go with block list of block grid here 🤔
s
we often use the blockgrid for our layout. If we want to add a list of different items, like a list of contact cards or something, we add a blocklist within a blockgrid component
but there are many that use the blocklist for layout/content as well
when you add your first blockgrid item, you are asked if you want to add some demo content. They will help you get a handle on thing
z
Thanks for the suggestion 📿
Atm I'm working on getting the hang of viewcomponents. I want Umbraco to dynamically render items in blocklists as their given type:
But I'm not sure what to make of the ViewComponent class itself
And when does Umbraco use different views
12 Views