I am accessing the quick launch nodes programmatically by using
SPWeb currWeb = SPContext.Current.Web;
SPNavigationNodeCollection nodes = currWeb.Navigation.QuickLaunch;
foreach (SPNavigationNode node in nodes)
{
...
}
Strange thing is that there are more nodes in the collection than i see in SharePoint in the quick launch! The extra nodes that are in the collection are the different sub webs.
But i only want to use the "real" elements that are in the quick launch. How can i access them?
It is since i turned on the publishing features i have this issue. And using
if (PublishingWeb.IsPublishingWeb(currWeb)) {
PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(currWeb);
nodes = pubWeb.Navigation.CurrentNavigationNodes;
}
to get the nodes gives the same results.