I have site created from web template. The link site pages is redirectinjg to home page but not to the site pages library. i can navigate to library but typing url directly. Please suggest why this is happening
4 Answers
Its because the Home.aspx (may be another page in your case) is set as a welcome page for the library root folder. Below should fix it
$web = Get-SPWeb "http://site"
$list = $web.Lists["Site Pages"]
$rootfolder = $list.RootFolder
$rootfolder.WelcomePage = "Forms/AllPages.aspx"
$rootfolder.Update()
Write-Host $list.RootFolder.WelcomePage
$web.Dispose()
The site you have used for creating web template, has the hard coded navigation url for Site Pages Library. So on top-level site, remove the hard coded navigation URL's and then create a Web Template. After that you can create a Site from the Template.
I don't know why, but you can goto "Site Actions-->Site Settings-->Look and Feel-->Navigation-->Navigation Editing and Sorting" to correct it, change the link's url to the right one. If you can't find the "Navigation" setting, please enable the "SharePoint Server Publishing Infrastructure" in your "Site collection features".
Goto Site Actions >> Site Settings >> Quick Launch, Delete Existing Site Pages, Click New Navigation Link, and add Url of Home page, Type Name 'Site Pages' in Description.
-
hi Viraj, You can do it without deleting Pages from SitePages. You should suggest a proper way for this not to delete Pages. I hope you can understand. Commented Oct 17, 2012 at 12:16