2

How can I add a link on the quick launch of a subsite, which bring us on the level 2 subsite ?

if I do

$spweb = Get-SPWeb http://url:portwebapp/SiteCollection/SUBSITE1/SUBSITE2

Then

$spweb.AddToQuickLaunch

It doesn't work =/

I want to have links for all my SUBSITE2, on the quick launch of the SUBSITE1

Thanks,

Nico.

1
1

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

2
  • 1
    thank you again @Benny ^^ . Your link was already in my bookmarks bar :D I didn't see your response when i posted mine, sorry. But i think we both said the same thing, and we agree.
    – Nico
    Jul 3 '13 at 9:15
  • @Nico You're Welcome! That can sometimes happen while editing. Maybe we were?! Great that you managed to find the answer!
    – Benny Skogberg
    Jul 3 '13 at 9:22
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.