I am having some trouble getting a webpart on the homepage of my 2013 Team site into Edit mode. Home.aspx is a wiki page as I'm using the Publishing feature. The webparts are there but not editable through the edit mode. Here is the code I'm using (truncated) to put a specific view on the page.
$wpm = $spweb.GetLimitedWebPartManager($pageUrl, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
$listTemplate = [Microsoft.SharePoint.SPListTemplateType]::Tasks
$listName = "Work Tasks"
$ViewID = $list.Views["My Active Tasks"].id
$ViewURL = $list.Views["My Active Tasks"].url
$ListViewWebPart = New-Object Microsoft.SharePoint.WebPartPages.XsltListViewWebPart
$ListViewWebPart.FrameState="Normal"
$ListViewWebPart.Title = "My Active Tasks"
$ListViewWebPart.ListName = ($list.ID).ToString("B").ToUpper()
$ListViewWebPart.ViewGuid = ($ViewID).ToString("B").ToUpper()
$ListViewWebPart.Dir="Default"
$ListViewWebPart.ZoneID = "wpz"
$ListViewWebPart.PartOrder = 0
$ListViewWebPart.TitleUrl = $ViewURL
$ListViewWebPart.DetailLink = $ViewURL
$wpm.AddWebPart($ListViewWebPart, "", 0)
The webparts are making it onto the page but not in the way they would if added from the ribbon. What am I missing?
Love them all...regardless. - Buddha