Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
In the sample code, this is how you get the Home page from a .cshtml file
var homePage = CurrentPage.AncestorsOrSelf(1).First();
Now, how do I get a specific page/node (not related to current page, eg. the News page) by its ID?
And btw I'm wondering, what is the Type of the homePage in the above code? Is it a Node?
var myNode = Umbraco.Content(1234)
Yes homePage it's a node
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Razor: How to get a Document/Node by ID?
In the sample code, this is how you get the Home page from a .cshtml file
Now, how do I get a specific page/node (not related to current page, eg. the News page) by its ID?
And btw I'm wondering, what is the Type of the homePage in the above code? Is it a Node?
Yes homePage it's a node
is working on a reply...