I’ve been writing a client side object model script to set up some sites, including setting some the navigation settings on the site. Sadly, Microsoft have written SharePoint to involve at least 3 objects in the navigation settings for a site (PublishingWeb, WebNavigationSettings, and SPNavigation. At least. It’s totally effing bonkers.), and those objects don’t work in quite the same way for CSOM. For example, it’s not clear how to set a site to ‘show subsites’ in the global navigation.
Fortunately, Bex Gordon has an example – in short, set the property through the AllProperties:
web.AllProperties["__GlobalNavigationIncludeTypes"] = ...
The same works for "__CurrentNavigationIncludeTypes"
too. Values are 0-3 – a bit mask. The first bit is for Show Subsites, the second is Show Pages.
Some other settings such as the maximum number of dynamic items to show, etc., can set in a similar fashion. Ugly, but works – which is more than can be said for the API…