-
Hi The PnP Core SDK documentation https://pnp.github.io/pnpcore/using-the-sdk/navigation-intro.html states It clearly also tells how to retrieve the nav nodes at the top level of eitehr QucikLaunch or TopNavigation. In my case I'm interested in QuickLaunch so this line works:
I can then iterate around "topLevelNodes" but I want to find the Children of a node In the PnP powershell, there is a property "navNode.Children" that allows me to access the Children How do I gain access the child nodes of this parent node in PnP.Core? I thought it might be But that does not work. Any help appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@metkhoo : below code works for me: var nodes = await context.Web.Navigation.GetAsync(n => n.QuickLaunch);
foreach (var item in nodes.QuickLaunch.AsRequested())
{
if (item.Title == "I have child nodes")
{
var childNodes = await item.GetChildNodesAsync();
foreach(var childNode in childNodes)
{
Console.WriteLine(childNode.Title);
}
}
} |
Beta Was this translation helpful? Give feedback.
@metkhoo : below code works for me: