Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Can't get "Display the same navigation as the parent site" to work

$
0
0

Hi, all

I'm trying to provision a subsite using code. The site is created alright, but I want the Global Navigation to be "Display the same navigation as the parent site". It's not, it's using Structural Navigation.

The funny thing is that when I open the Navigation Settings in my browser, the correct option (same as parent) is selected! If I just click OK to save the settings, my site is updated and is now using the same navigation as the parent.

Does anyone have an idea why I need to enter Navigation Settings and click OK to make this work?

SPWeb web = (SPWeb)properties.Feature.Parent;

WebNavigationSettings webSettings = new WebNavigationSettings(web);
if (webSettings == null)
{
    // Something weird happened. Just exit.
    return;
}

webSettings.GlobalNavigation.Source = StandardNavigationSource.InheritFromParentWeb;
webSettings.Update();



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>