none
Provisioning a Page with a Content Editor Web Part RRS feed

  • Question



  • I am provisioning a page with a content editor web part to a document library through a site definition solution.
    It is an FAQ page that I would like to prepopulate with information and then let certain users contribute to the FAQ in the future. I was wondering if it was possible to add the content to the page during the provisioning? Right now the page is blank when I browse to it after it has been provisioned. 
     
    Wednesday, February 18, 2009 6:19 PM

Answers

  • If you are provisioning the page through a "module" in the site definition (or a feature) then you should be able to add the "AllUsersWebPart" tag as a child of the "File" tag. In here you can put the web part XML that you get when you export the web part from SharePoint, so go and put a content editor on the page, set it up the way you want it including default content, then export that and use the XML in the module. So the module would look like:

    <Module Name="test" ... >
        <File name="faq.aspx" ...>
            ...

            <AllUsersWebPart WebPartZoneId="Top" WebPartZoneOrder="1">
            <![CDATA[
            WEB PART XML GOES HERE
            ]]>
            </AllUsersWebPart>
        </File>
    </Module>
    Brian Farnhill
    Microsoft Certified Application Developer
    blog.brianfarnhill.com
    Canberra SharePoint User Group
    • Marked as answer by O Town Wednesday, February 18, 2009 8:33 PM
    Wednesday, February 18, 2009 7:54 PM