Search code examples
sharepointmossnavigationwindows-sharepoint-services

Sharepoint create site navigation through programming


I have a requirement in sharepoint where I want to Create the top link navigation based on excel file. Means The site navigation structure (along with parent site subsite under parent site) is mention in excel file. I need to read that structure and based on modify the navigation in sharepoint.

Please can any one tell me is it possible to configure navigation in such a way. If yes then please tell me how to achive it.

FYI: I am using MOSS 2007.

thanks in advance

sachin katkar


Solution

  • If this is a Publishing site, you can use code similar to the following:

    PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(SPContext.Current.Web);
    SPNavigationSiteMapNode.CreateSPNavigationNode(title, url, NodeTypes.AuthoredLinkToPage, publishingWeb.GlobalNavigationNodes);
    publishingWeb.Update();