Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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">
                    <![CDATA[         
                             <WebPart 
                               xmlns="http://schemas.microsoft.com/WebPart/v2"
                               xmlns:cewp="http://schemas.microsoft.com/WebPart/v2/ContentEditor">
                               <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
                               <TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
                               <Title>Project xxx</Title>
                               <FrameType>TitleBarOnly</FrameType>
                               <cewp:Content>
                                 This Web Part was added through declarative logic in ONET.XML 
                               </cewp:Content>
                             </WebPart>
                             ]]>
                  </AllUsersWebPart>              
          </File>
        </Module>
share|improve this question

2 Answers 2

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 http://blogs.msdn.com/b/cjohnson/archive/2006/11/01/feature-stapling-in-wss-v3.aspx

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

 
discard

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.