Añadir un nivel 2 subsito a un lanzamiento rápido de su subsito de nivel 1
-
10-12-2019 - |
Pregunta
¿Cómo puedo agregar un enlace en el lanzamiento rápido de un subsito, que nos trae en el subsito de nivel 2?
si lo hago
$spweb = Get-SPWeb http://url:portwebapp/SiteCollection/SUBSITE1/SUBSITE2
luego
$spweb.AddToQuickLaunch
no funciona= /
Quiero tener enlaces para todos mis subsite2 , en el lanzamiento rápido de la subsite1
gracias,
nico.
Solución
AddToQuickLaunch can only be used when you create a New-SPWeb. To change current navigation, you need to tell SharePoint where to place your links. Like the following:
$web = Get-SPWeb http://portal/sites/subsite1
$qlNav = $web.Navigation.QuickLaunch
$qlNewPreviousSibling = $qlNav | where { $_.Title -eq "Libraries" }
$headingNode = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode("SUBSITE2", "")
$qlNav.Add($headingNode, $qlNewPreviousSibling)
$qlHeading = $qlNav | where { $_.Title -eq "SUBSITE2" }
$linkNode = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode("Subsite2 - Links", "/sites/subsite1/subsite2/Lists/Links/AllItems.aspx")
$qlHeading.Children.AddAsLast($linkNode)
Reference: Managing Quick Launch navigation in SharePoint Foundation using PowerShell
Otros consejos
I've just realized, that I can create a title call "Subsites" on my Subsite1. Then create a sub-title for each subsite2 (insubsite1) and call them with the name of the subsite2, and with their url.
But if someone knows a easier way to do it, as .AddQuickLaunch
let me know !
EDIT : and btw, when i create the subsite, their is a -AddToquickLaunch
with the New-SPWeb
command. See this.