Use the following Powershell in order to change the behavior of the managed navigation when you create a new page. Replace whether by true or false in order to fit the needs.
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$site = Get-SPSite $siteUrl;
$site.AllWebs | foreach {
$webNav = $_.Properties["_webnavigationsettings"];
$webNav ;
#Replace AddNewPagesToNavigation="True" and CreateFriendlyUrlsForNewPages="True"
$webNav = $webNav.Replace('AddNewPagesToNavigation="True"','AddNewPagesToNavigation="False"');
$webNav = $webNav.Replace('CreateFriendlyUrlsForNewPages="True"','CreateFriendlyUrlsForNewPages="False"');
$_.Properties["_webnavigationsettings"] = $webNav;
$_.Properties.Update();
$_.Update();
}
Aucun commentaire :
Enregistrer un commentaire