This project is read-only.

There are several ways you can use in order to create a wiki page provisioning feature. The following steps will guide you through one of these ways. Before starting, make sure you have deployed SPWikiProvisioning.wsp to your SharePoint farm or include a reference to SPWikiProvisioning.dll into your project.

  1. Open Visual Studio 2010 and create a new Empty SharePoint Project
  2. Right-click on the Features node and select Add Feature.
  3. Give the new feature the desired name and description and ensure you select Web scope as you will be creating Wiki pages at this level
  4. Go to the feature properties and enter the following information
    1. Receiver assembly: SPWikiProvisioning, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e098d62d5efd1002
    2. Receiver class: SPWikiProvisioning.Receivers.WikiPagesProvisioningReceiver
  5. Right-click on he Project node and add a new item of type Module
  6. Verify the newly created module has been automatically added to the previously created feature
  7. Add a new file to the Module called ProvisioningElements.xml (*)
  8. Add content from listing 1 later in this page to the new file
  9. Deploy your solution and activate the feature you just created in any existing SharePoint site
  10. Verify a new page called New Page has been created in your site 

Listing 1

 

<WikiPages>
  <WikiPage>
    <Title>New Page</Title>
    <Default>false</Default>
    <WikiField>
      <![CDATA[
        <table id="layoutsTable" style="width: 100%">
          <tbody>
            <tr style="vertical-align:top">
              <td style="width: 66.6%">
                <div class="ms-rte-layoutszone-outer" style="width:100%">
                  <div class="ms-rte-layoutszone-inner" style="min-height:60px;word-wrap:break-word"></div>
                </div>
              </td>
              <td style="width: 33.3%">
                <div class="ms-rte-layoutszone-outer" style="width: 100%">
                  <div class="ms-rte-layoutszone-inner" style="min-height:60px;word-wrap:break-word"></div>
                </div>
              </td>
            </tr>
          </tbody>
        </table>
        <span id="layoutsData" style="display: none">false,false,2</span>
      ]]>
    </WikiField>
  </WikiPage>
</WikiPages>

(*) Note: you can use any name for this file. Check out the documentation on how to use different provisioning file names.

 

 

Last edited Dec 21, 2011 at 7:54 PM by davidmartos, version 5

Comments

No comments yet.