Update with PnP Navigation Settings


Hi all,


I need to update the property Show pages on Site Settings > Navigation Settings > Global Navigation > Show Pages using PnP


I'm not able to find the way for doing it. Thank you!



Hide Show pages Global navigation.PNG




3 Replies

Last time I looked (Over a year ago) you couldnt do with PNP but you can with others eg






hi, that's controlled by a property on the spweb object, you can update in using power shell by updating the webs property bag.


web.AllProperties["__GlobalNavigationIncludeTypes"] = "1";

As Peter says, this is not currently available using PnP Core and PnP Schema, but as Russell says, you have to set a specific value in a property, so, you could use the "PropertyBagEntry" on a PnP Provisioning template, but then ensure that when you Apply the template you set the "OverwriteSystemPropertyBagValues" (ProvisioningTemplateApplyingInformation object) to true, or the process won't update the PropertyBag (as is a system property).

Another option is that you create your own ExtensibilityHandler, and use some custom CSOM code to do that in a more configurable way. This article has the required CSOM code to configure those nav settings using CSOM:

Here you can find a sample on How to create a custom ExtensiblityHandler: