I am trying to add the Web Parts to Page Instance of the Page Layout using a Feature.I know it should be through AllUsersWebPart element .I could find the reference of adding a Default Web Part to Page Layout (PortalLayouts feature does it). Also I have seen same in onet.xml . I wanted to know if it possible to create an instance of the page based on the Page layout and add web part to it using the feature.
R – Adding Web Parts to the Page Instance based on Page Layout using Feature
sharepointsharepoint-2007web-parts
Best Answer
Inside a feature activation event handler ...
Get the Page to add the webpart (in this case - default.aspx)
Get the Webpart Manager
Then create a webpart instance
Then a Webpart Action
And finnally add the webpart ...
And it's done ... a new webpart in our page, I hope this helps ;)
For more informations please check this article http://blogs.msdn.com/sharepoint/archive/2007/03/22/customizing-moss-2007-my-sites-within-the-enterprise.aspx