Views
Last updated
Last updated
Normal .Net Razor Views are used to display the content from your content types to the front end user of your website. A content type could have many content views, which in turn allows the user to select different Views (Think templates) to render their content. All Views must inherit from ZauberViewPage<T> to show in the Allowed Views selection on a content type (More about this below)
As you can see, on content, the user can only select a one View from whatever Content Views you have allowed them to choose from (See above)
Just like a normal MVC project, all Views go into the Views folder in the root of your project. The folder convention works exactly like a normal MVC project. The only difference is by default, Content views are looked for in the root of the Views folder if you have not created a Controller (Route Hi-Jacking).
Any View that you want to use for your Content must inherit from ZauberViewPage<T>, where T by default would be 'Content' as Content is passed by default into the View.
This will allow you to use @Model in the View and get data from the Content model (Or Model of your choice). If you want to use a custom model, then you need to add a controller (Route Hi-Jacking).
The below example is the Home View from the starter site