Search code examples
sharepointnavigationweb-parts

Reading Global Navigation in SharePoint from a Web Part


Is it possible to read the Global Navigation of all the sub sites and display the items (links or category) from a Web Part that should be in a master page?

Don't forget that the global navigation can be edited in the settings, so I can't just loop on pages and sub sites. :(


Solution

  • You can read the navigation using : SPNavigationNodeCollection navNodes = web.Navigation.QuickLaunch;