Good day, I am looking for solution to make custom top navigation menu.
I got site collection and 3-4 nested sites. Builtin top navigation menu shows link like this:
| SiteCollectionLink | NestedSite1 | NestedSite2 | etc.
when i use:
myWeb = SPContext.Current.Web.Site.RootWeb;
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(myWeb);
SPNavigationNodeCollection nodeColl = publishingWeb.Navigation.GlobalNavigationNodes;
foreach (SPNavigationNode node in nodeColl)
{
//node processing
}
i got only NestedSite1 and NestedSite2 as nodes with no main node as it’s not in there.
So i wonder how can i take first node?
(builtin navigation menu sohws it as well)
Found out myself, if anyone futher will face it, try this: