I have the following code working for grabbing and looping multiple content items of a specific document type in a template:
var selection = CurrentPage.Site().Children("NewsArticle").Where("Visible");
foreach (var item in selection) { etc etc }
What I am trying to accomplish is to grab content from outside the current page. I have created a new document type "RightColumnNews". I want to grab any content of that doc type and loop through the results regardless of what page is currently being viewed.
I had my RightColumnNews items inside a specific content parent. I set the parent target by using the content ID, then looked for children of that ID which contained the specific doc type alias:
var node = Umbraco.Content(1089);
foreach (var item in node.Children("RightColumnNews").Where("Visible")) { etc etc }
Grab content not related to the current page?
I have the following code working for grabbing and looping multiple content items of a specific document type in a template:
What I am trying to accomplish is to grab content from outside the current page. I have created a new document type "RightColumnNews". I want to grab any content of that doc type and loop through the results regardless of what page is currently being viewed.
Here's what got it working
I had my RightColumnNews items inside a specific content parent. I set the parent target by using the content ID, then looked for children of that ID which contained the specific doc type alias:
is working on a reply...