I want to to prelocate a Search Results web part on a custom publishing page layout.
<WebPartPages:WebPartZone runat="server" Title="Overview Page Web Part Zone" ID="WpZoneOverviewTeasers" AllowLayoutChange="True" AllowCustomization="True" FrameType="TitleBarOnly"> <ZoneTemplate> <SearchWC:ResultScriptWebPart ID="ResultScriptWebPart1" runat="server" AllowEdit="True" /> </ZoneTemplate> </WebPartPages:WebPartZone>
Unfortunately that does not quite work. The web part is there but I cannot customize it nor can I delete it. Both of which I want editors to be able to.
I do not want to use a AllUsersWebPart module to provision any web parts. I think that's a good option if you want to make web parts available on a "feature activate" basis.
Another option is to use a custom control to register webparts the first time the page is put into edit mode. See http://code.msdn.microsoft.com/office/Adding-default-web-parts-ab7aec72. Not a big fan either. Mostly because you cannot define properties of the webparts you want to prelocate.
So how do you deploy publishing page layouts with preconfigured web parts on them? Remember authors should be able to configure the web parts to suit their needs and also be able to remove them entirely.