Question

Is it possible to provision a Web Part Page using a Module element with a SetupPath specified, rather than a Path specified? For example, if I wanted to create a module to provision a page from: TEMPLATE{LCID}\STS\DOCTEMP\SMARTPGS (which I believe are the templates used when you Create a new Web Part Page from the SP Web Based interface using Site Actions > More Options > Pages > Web Part Page).

  <!-- from templates used from Web Part Page Create page (_layouts/spcf.aspx) -->
  <!-- TODO: dynamically determine LCID?? is there a replacement token that can be used?? -->
  <Module Name="SitePages" SetupPath="1033\STS\DOCTEMP\SMARTPGS\" >
    <File Path="spstd4.aspx" Url="SitePages/Brian_SMARTPGS.aspx">
    </File>
  </Module>

I get the "File" provisioned, and it shows in SPD when I view the contents of the SitePages Wiki Page Library, however, when I view using the AllItems.aspx view, I don't see it. If I create the Web Part Page using the SP Web Based Interface, I do see it in AllItems.aspx.

I think the root of this is that the files get provisioned, and can be browsed, however they are stored as File, and not Wiki Page.

Thoughts?

Was it helpful?

Solution

Looks like it is possible. I had to handle my Module element a bit differently. The key was to add a List="119" (for the Wiki Page Library), a Url="SitePages" to the Module. Then in the File elements, ensure Type="GhostableInLibrary" is set.

I found this resource which helped me come to this conclusion: http://blogs.msdn.com/b/pavankumar/archive/2009/02/25/custom-wiki-site-definition-with-custom-document-template-for-creating-wiki-pages.aspx

Here are some sample elements that you can use to try it out:

  <!-- from "Team Site" Site Template-->
  <Module Name="TeamSite" SetupPath="SiteTemplates\STS\" List="119" Url="SitePages" >
    <File Path="Default.aspx" Url="Brian_STS.aspx" Type="GhostableInLibrary" />
  </Module>

  <!-- from templates used from Web Part Page Create page (_layouts/spcf.aspx) -->
  <!-- TODO: dynamically determine LCID?? is there a replacement token that can be used?? -->
  <Module Name="SmartPages" SetupPath="1033\STS\DOCTEMP\SMARTPGS\" List="119" Url="SitePages" >
    <File Path="spstd4.aspx" Url="Brian_SMARTPGS.aspx" Type="GhostableInLibrary" >

    </File>
  </Module>


  <!-- from Wiki Page template -->
  <Module Name="Wiki" SetupPath="DocumentTemplates\" List="119" Url="SitePages" >
    <File Path="wkpstd.aspx" Url="Brian_Wiki.aspx" Type="GhostableInLibrary" >

    </File>
  </Module>
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top