Im following Paul Seals videos on taking a static bootstrap site and converting it to an Umbraco CMS site. The tutorial is being done on v7 but I have v8 installed.
It’s all going fine, but I can’t figure out how to get the current page in a partial view.
The tutorial uses
@inherits UmbracoTemplatePage
<h2>@CurrentPage.intro</h2>
intro being a document type of text box input which I added to my home page under compositions.
Under content I can now enter text into my new control, but Im not sure how to insert this into the <h2> tag as above.
If needed here is the video, the relevant part is at 10:56
https://www.youtube.com/watch?v=zRDHK_isHCQ&list=PL90L_HquhD–OWQNLyO1-KRxVDd0NPBfZ&index=5
I have tried using
@inherits UmbracoViewPage
<h2>@Model.Value("intro")</h2>
but get a null reference exception.
thanks
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/96521-umbraco-8-get-current-page-from-partial-view