The following code should generate an ASCII art tree of a sharepoint website. But Navigation.QuickLaunch is only returning entries where the navigation order has been customised.
Does anyone know how to get around this? I need to use the same data as the quick launch area as the order the subsites are displayed in is important in some areas.
Merely disabling the automatic sorting doesn't seem to be enough to force it.
void RecurseNavigation(SPWeb web)
{
depth += 1;
foreach (SPNavigationNode node in web.Navigation.QuickLaunch)
{
sb.Append(new String('-', depth));
sb.AppendLine(node.Title + " (" + node.Url + ")");
RecurseNavigation(root.OpenWeb(node.Url));
}
depth -= 1;
}