Monday, August 29, 2011

Sharepoint 2010: Update SPNavigationNode Title

as per my requirement i need to update "Library" node to "Libraries"


Namespace:  Microsoft.SharePoint.Publishing.Navigation
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
Syntax:

here is the Powershell Script :
public static SPNavigationNode UpdateSPNavigationNode(
         SPNavigationNode node,
         SPNavigationNode previous,
         string name,
         string url,
         string description,
         string target,
         string audience,
         bool forceCreate
)


$webURL="http://servername/sites/P000527/"
$web=Get-SPWeb $webURL
$navigationNode=$web.Navigation.QuickLaunch
$LibraryNode = $navigationNode | where { $_.Title -eq "Library" }
$HomeNode= $navigationHomeNode | where { $_.Title -eq "Home" }
$NewTitle= "Libraries"
[Microsoft.SharePoint.Publishing.Navigation.SPNavigationSiteMapNode]::UpdateSPNavigationNode($LibraryNode, $HomeNode, $NewTitle, $LibraryNode.Url, "", "", "", $false)
$web.Dispose()



No comments:

Post a Comment

Followers

Blog Archive