Search code examples
sharepointweb-parts

How to add a web part page to a site definition?


I have to create a site definition for a client that must contain pre-defined web part pages. I can create the web part pages but am at a loss when it comes to attaching them to the site on creation.

I know web part pages created through SharePoint are stored in a Document Library. Do I need to pre-populate a "Web Part Pages" document library and add the needed navigation to these files? If so, how do I go about adding the needed aspx files?

Finally, are there any caveats that I should be aware of for configuring the custom web part page in onet?


Solution

  • You can follow this methodology which uses Feature Stapling. I used this to automatically add web parts to My Sites when they are created:

    http://blogs.msdn.com/sharepoint/archive/2007/03/22/customizing-moss-2007-my-sites-within-the-enterprise.aspx