Update with PnP Navigation Settings

%3CLINGO-SUB%20id%3D%22lingo-sub-65377%22%20slang%3D%22en-US%22%3EUpdate%20with%20PnP%20Navigation%20Settings%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-65377%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20update%26nbsp%3Bthe%20property%20Show%20pages%20on%20Site%20Settings%20%26gt%3B%20Navigation%20Settings%20%26gt%3B%20Global%20Navigation%20%26gt%3B%20Show%20Pages%20using%20PnP%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20not%20able%20to%20find%20the%20way%20for%20doing%20it.%20Thank%20you!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20768px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F13820iF4BF12FC8CE4C83F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Hide%20Show%20pages%20Global%20navigation.PNG%22%20title%3D%22Hide%20Show%20pages%20Global%20navigation.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-65705%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20with%20PnP%20Navigation%20Settings%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-65705%22%20slang%3D%22en-US%22%3EAs%20Peter%20says%2C%20this%20is%20not%20currently%20available%20using%20PnP%20Core%20and%20PnP%20Schema%2C%20but%20as%20Russell%20says%2C%20you%20have%20to%20set%20a%20specific%20value%20in%20a%20property%2C%20so%2C%20you%20could%20use%20the%20%22PropertyBagEntry%22%20on%20a%20PnP%20Provisioning%20template%2C%20but%20then%20ensure%20that%20when%20you%20Apply%20the%20template%20you%20set%20the%20%22OverwriteSystemPropertyBagValues%22%20(ProvisioningTemplateApplyingInformation%20object)%20to%20true%2C%20or%20the%20process%20won't%20update%20the%20PropertyBag%20(as%20is%20a%20system%20property).%3CBR%20%2F%3E%3CBR%20%2F%3EAnother%20option%20is%20that%20you%20create%20your%20own%20ExtensibilityHandler%2C%20and%20use%20some%20custom%20CSOM%20code%20to%20do%20that%20in%20a%20more%20configurable%20way.%20This%20article%20has%20the%20required%20CSOM%20code%20to%20configure%20those%20nav%20settings%20using%20CSOM%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fblog.vgrem.com%2F2013%2F10%2F22%2Faccess-and-manipulate-navigation-settings-via-sharepoint-client-object-model%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fblog.vgrem.com%2F2013%2F10%2F22%2Faccess-and-manipulate-navigation-settings-via-sharepoint-client-object-model%2F%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EHere%20you%20can%20find%20a%20sample%20on%20How%20to%20create%20a%20custom%20ExtensiblityHandler%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2FPnP%2Ftree%2Fmaster%2FSamples%2FProvisioning.Extensibility%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2FPnP%2Ftree%2Fmaster%2FSamples%2FProvisioning.Extensibility%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-65660%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20with%20PnP%20Navigation%20Settings%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-65660%22%20slang%3D%22en-US%22%3E%3CP%3Ehi%2C%20that's%20controlled%20by%20a%20property%20on%20the%20spweb%20object%2C%20you%20can%20update%20in%20using%20power%20shell%20by%20updating%20the%20webs%20property%20bag.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eweb.AllProperties%5B%22__GlobalNavigationIncludeTypes%22%5D%20%3D%20%221%22%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-65381%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20with%20PnP%20Navigation%20Settings%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-65381%22%20slang%3D%22en-US%22%3E%3CP%3ELast%20time%20I%20looked%20(Over%20a%20year%20ago)%20you%20couldnt%20do%20with%20PNP%20but%20you%20can%20with%20others%20eg%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsharepoint.stackexchange.com%2Fquestions%2F202858%2Fnavigation-settings-csom-powershell-for-sharepoint-online%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsharepoint.stackexchange.com%2Fquestions%2F202858%2Fnavigation-settings-csom-powershell-for-sharepoint-online%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

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
Highlighted

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

 

https://sharepoint.stackexchange.com/questions/202858/navigation-settings-csom-powershell-for-sharep...

 

 

 

Highlighted

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";

Highlighted
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:
https://blog.vgrem.com/2013/10/22/access-and-manipulate-navigation-settings-via-sharepoint-client-ob...

Here you can find a sample on How to create a custom ExtensiblityHandler:
https://github.com/SharePoint/PnP/tree/master/Samples/Provisioning.Extensibility