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
I call a view from a template and pass an 'item' obejct to it:
It works fine and I can call properties in my 'item' object in the view with
But how can I get the Model of the page (node) that the view is called from? Model no longer refers to the page that the website visitor is viewing.
If you make your partial view have an inherits statement at the top eg:
(instead of any normal MVC @model declaration you might have)
Then you can access the current page model via:
Thanks, Marc! That was just my need! :)
Changed it to:
And now I can call for instance:
Umbraco.AssignedContentItem.Children().Where(x => x.IsVisible());
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted