Thursday, March 28, 2013

Default viewnot pointing to AllItems.aspx

Issue:
The landing page  for "Site Pages"/"Pages" library will not be AllItems.aspx. Even if we change the library settings for default view, the change is not committed.

Solution:
In such cases, run the following PowerShell script.

$site = Get-SPSite "http://SITEURL"
$web=$site.OpenWeb()
$list = $web.Lists["Site Pages"]
$rootfolder = $list.RootFolder
$rootfolder.WelcomePage = "Forms/AllPages.aspx"
$rootfolder.Update()
Write-Host $list.RootFolder.WelcomePage
$web.Dispose()

 

No comments: