1

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?

1 Answer 1

1

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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