Sharepoint - Navigation.QuickLaunch has missing items
- by linqmonkey
The following code generates an ASCII art tree view of a sharepoint site structure based on the items in the quick launch menu. But some are missing.
From googling i've found suggestions that this may be because QuickLaunch only contains items that have been customised.
Any idea how to fix this? I want to use the QuickLaunch items as many of the sites have subsites and pages that need to be displayed in a specific order.
RecurseNavigation(SPWeb web)
{
depth++;
foreach (SPNavigationNode node in web.Navigation.QuickLaunch)
{
Console.Write(new String('-', depth));
Console.WriteLine(node.Title + " ("+node.Url+")");
RecurseNavigation(root.OpenWeb(node.Url));
}
depth--;
}