SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have about 20 custom aspx pages that I need to deploy whenever a site is provisioned.

I tried the following code but the aspx page didnt get added. (I even activated the publishing but the aspx page is not when I do "all site content")

    <Module Name="Pages" >
          <File Url="Project_xxx.aspx" Type="Ghostable">
            <!-- Add a Web Part to left zone -->
                  <AllUsersWebPart WebPartZoneID="Left" WebPartOrder="0">
                               <Assembly>Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
                               <Title>Project xxx</Title>
                                 This Web Part was added through declarative logic in ONET.XML 
share|improve this question

You should use GhostableInLibrary instead of Ghostable when dealing with pages that belong in a library (here a publishing page in Pages library). Ghostable is for site pages.

Not sure its vital, but you also seem to be missing a <webparts> element outside your <webpart> element.

I agree that modules belong in seperate features. Depending on how you provision, I also agree feature stapling is good if you use OOB or custom site definitions, but the way to do it in SP2010 is custom web templates. CWT doesnt support feature stapling, so if you use that you will have to add them directly to the onet.xml.

Some links on custom web templates here.

share|improve this answer

I would put those pages in a feature and then staple the feature to the Team site. Or copy the Team site definition and add the new feature to it in the onet.xml. Feature stapling will upgrade to 2010 nicer though so I would recommend that approach. Here is how to staple a feature

share|improve this answer
Thanks for your help. If I put the aspx files in a feature then I have to create element.xml, right? then they will sit on a file share? And will this feature show up in the site feature page if yes i dont want end users accidentally activate it. – Roxanne May 5 '11 at 21:01
Alex, you could always hide the feature..... – David Palfery May 6 '11 at 4:32
Feature stapling does not work with Site Template – Roxanne May 7 '11 at 22:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.