Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
+1 Interesting Question! –  Benny Skogberg MCSA Jul 3 '13 at 9:22

2 Answers 2

up vote 0 down vote accepted

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

share|improve this answer
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 MCSA Jul 3 '13 at 9:22

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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