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
Hi,
I'm trying to load a Node which is in level 5 in my tree (I have confirmed this in umbraco.config).
Loading nodes up to 5 works fine with this code, but not for level 5 itself. It's strange. What's going on here:
public List<Core.Objects.SystemGoal> GetSystemGoals(int activityId) { var goals = new List<Core.Objects.SystemGoal>(); var node = new Node(activityId); foreach (Node child in node.Children) { if (child.NodeTypeAlias == Constants.UmbracoDocTypeAliases.SystemGoal) { var goal = new Core.Objects.SystemGoal(); goal.Id = child.Id; goal.Name = child.GetProperty(Constants.UmbracoDocTypeProperties.Heading).Value; goal.Description = child.GetProperty(Constants.UmbracoDocTypeProperties.SubHeading).Value; goals.Add(goal); } } return goals; }
Node.Children is always empty even though I know there are children.
Thanks,Greg.
Won't let me edit, but I'm using 4.8.1.
Just like to clarify as I've actually described the problem wrong!
It's not that the node isn't loading, this actually does work fine:
var node = new Node(activityId);
The problem is when I try to get children of that node, for some reason it's always empty even though it has children and they are all published:
foreach (Node child in node.Children)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Level 5 node doesn't load with nodeFactory
Hi,
I'm trying to load a Node which is in level 5 in my tree (I have confirmed this in umbraco.config).
Loading nodes up to 5 works fine with this code, but not for level 5 itself. It's strange. What's going on here:
Node.Children is always empty even though I know there are children.
Thanks,
Greg.
Won't let me edit, but I'm using 4.8.1.
Just like to clarify as I've actually described the problem wrong!
It's not that the node isn't loading, this actually does work fine:
The problem is when I try to get children of that node, for some reason it's always empty even though it has children and they are all published:
is working on a reply...