SharePoint online set “Structural Navigation: Display only the navigation items below the current site on Quick Launch"

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/229268

문제

So I'm trying to enable "Structural Navigation: Display only the navigation items below the current site" on all my subsites using pnp provisioning but it can't seem too get it working. I've both tried using and using properity bag but it wont work...

Anyone have an idea how to do it ?

도움이 되었습니까?

해결책

Below code works based on my test(publishing site).

using (var ctx = new ClientContext(siteUrl))
            {
                SecureString securePassword = new SecureString();
                foreach (char c in password.ToCharArray()) securePassword.AppendChar(c);
                ctx.Credentials = new SharePointOnlineCredentials(userName, securePassword);
                AreaNavigationEntity nav = new AreaNavigationEntity();
                nav.CurrentNavigation.ShowSubsites = true;
                nav.CurrentNavigation.ShowPages = true;
                ctx.Web.UpdateNavigationSettings(nav);

            }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top