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
Is there an easy way to access the other pages of the website from within a Block List view?
eg. in my regular partial views, I can access the home page node with the following:
var homeNode = Model.AncestorOrSelf(1);
Is it possible to do something similar within a block list item view?
As an answer to my own question, I just found I can do this to load a node by ID. Not perfect, but it will do for my situation:
var homeNode = Umbraco.Content(1063);
Check out this section -
https://our.umbraco.com/Documentation/Reference/Common-Pitfalls/#too-much-querying-over-querying
Hi jonok,
If I need access to "the outside world", I usually do something like this in a Block partial, so I don't have to rely on any hardcoded ids:
var currentPage = Umbraco.AssignedContentItem; var siteRoot = currentPage.Root();
Hope that helps, /Chriztian
Yes Chriztian - that's what I'm looking for, just couldn't find it when I was sifting through the docs. Thanks!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Block List - how to access other pages within a view
Is there an easy way to access the other pages of the website from within a Block List view?
eg. in my regular partial views, I can access the home page node with the following:
Is it possible to do something similar within a block list item view?
As an answer to my own question, I just found I can do this to load a node by ID. Not perfect, but it will do for my situation:
Check out this section -
https://our.umbraco.com/Documentation/Reference/Common-Pitfalls/#too-much-querying-over-querying
Hi jonok,
If I need access to "the outside world", I usually do something like this in a Block partial, so I don't have to rely on any hardcoded ids:
Hope that helps, /Chriztian
Yes Chriztian - that's what I'm looking for, just couldn't find it when I was sifting through the docs. Thanks!
is working on a reply...