How to get the overall page ID if passing in another node as a model
I have a partial that I pass a settings node to. The partial inherits from UmbracoViewPage
Inside the view, I want to get the current PAGE id for the outer page that's being rendered. Everything I can find seems to indicate that I should use:
@Umbraco.AssignedContentItem
However, in partials where I have passed in a different node, the AssignedContent item is what I passed into the view, not the outer page. Am I using the wrong method? Obviously you used to be able to get the PublishedContentRequest and get it from there......
Similar to how UmbracoViewPage has an Umbraco property, there is also an UmbracoContext property. So I think the following line is what you're looking for:
How to get the overall page ID if passing in another node as a model
I have a partial that I pass a settings node to. The partial inherits from UmbracoViewPage
Inside the view, I want to get the current PAGE id for the outer page that's being rendered. Everything I can find seems to indicate that I should use:
However, in partials where I have passed in a different node, the AssignedContent item is what I passed into the view, not the outer page. Am I using the wrong method? Obviously you used to be able to get the PublishedContentRequest and get it from there......
Does anyone know how to achieve this V8?
Similar to how
UmbracoViewPage
has anUmbraco
property, there is also anUmbracoContext
property. So I think the following line is what you're looking for:Thanks Anders, that's exactly what I was looking for!
is working on a reply...