The model on grid templates seems to be only a dynamic of the contents of the grid, which doesn't expose Model.Content. It may be because I'm inheriting from UmbracoViewPage<dynamic> though.
UmbracoContext.Current.PublishedContentRequest.PublishedContent appears to be what I was looking for, thank you very much :)
Getting Current Page in Grid Partial
Hi,
I'm in a position where I need to reference information about the current page inside of the grid partial (Views/Partials/Grid).
Currently I use the following method
But I am unsure if this will cause unnecessary overhead as this grid will be used on every page on the website (sans the homepage).
Will pulling the current page from the cache in a grid cause a noticeable or unnecessary overhead?
Or is there some way for the current page to be exposed to me instead?
Hi,
You should be able to use Model.Content to access the current node you are on.
Other option is using for example
Hope this helps.
The model on grid templates seems to be only a dynamic of the contents of the grid, which doesn't expose
Model.Content
. It may be because I'm inheriting fromUmbracoViewPage<dynamic>
though.UmbracoContext.Current.PublishedContentRequest.PublishedContent
appears to be what I was looking for, thank you very much :)is working on a reply...