SharePoint Server OM provides PortalNavigation class that represents navigation for portal pages and other portal navigation objects. In turn the PublishingWeb class is used to access the navigation settings (PortalNavigation type).
What about Client Object Model? Unfortunately it is not supported to access and manipulate Navigation settings via CSOM since there is no PublishingWeb Client Object in SharePoint 2010. But still it possible to accomplish via Client Object Model.
Retrieving Web Client Object with Properties
The following example is aimed to demonstrate how to retrieve Web client object with it properties:
Access and manipulate Navigation settings via CSOM
The following class represents Client Object Model (CSOM) implementation of PortalNavigation class:
The following example demonstrates how to print and update navigation settings using ClientPortalNavigation class :
Since Publishing API is not supported in Client Object Model of SharePoint 2010, there is no way to manage the navigation settings for a publishing site the same way as in Server Object Model. But as was demonstrated in this article it could be accomplished via Web Client Object and Web.AllProperties property.
In turn, in SharePoint 2013 Microsoft.SharePoint.Client.Publishing.Navigation namespace was introduced, in particular WebNavigationSettings class for managing the navigation settings for a publishing site.
- Microsoft.SharePoint.Client Namespace
- Microsoft.SharePoint.Client.Publishing.Navigation namespace (SharePoint 2013 only)
- Retrieving a SharePoint Client Object Does Not Retrieve All Properties