1

I'm currently using SharePoint 2016. I want to add a document library webpart to my site definition landing page in the . I have this in my default.aspx

<WebPartPages:WebPartZone runat="server" Title="DocumentLibZone" ID="WebPartZone1"></WebPartPages:WebPartZone>

and my onet.xml currently look like this:

    <?xml version="1.0" encoding="utf-8"?>
   <Project Title="Workspace" Revision="2" ListDir="" xmlns:ows="Microsoft SharePoint" xmlns="http://schemas.microsoft.com/sharepoint/">
  <NavBars>
  </NavBars>
    <Configurations>
      <Configuration ID="-1" Name="NewWeb"></Configuration>
      <Configuration ID="0" Name="Workspace">
      <Lists/>
      <SiteFeatures>
    <!-- feature IDs -->

      </SiteFeatures>
      <WebFeatures>
    <!-- feature IDs -->
     <!-- Document Library -->
        <Feature ID="00bfea71-e717-4e80-aa17-d0c71b360101" />

      </WebFeatures>
    </Configuration>
    <Configuration ID="1" Name="Workspace">
      <Lists/>
      <SiteFeatures/>
      <WebFeatures />
      <Modules />
    </Configuration>
    <Configuration ID="2" Name="Workspace">
      <Lists/>
      <SiteFeatures/>
      <WebFeatures />
      <Modules />
    </Configuration>
  </Configurations>
  <Modules />
</Project>

Do note that the default.aspx is located in a Module called Test and my onet.xml is located in a Site Definition called WorkTest. These 2 are in the same project.

  • when i tried to put in <Modules><Module><File>, it throw my this error: Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection1& featureDependencyErrors) at Microsoft.SharePoint.ApplicationPages.TemplatePickerUtil.ApplyWebTemplateAndRedirect(SPWeb Web, String strWebTemplate, Nullable1 bSharedNav, Boolean bOnTopNav, Boolean bOnQuickLaunch, Page page, Boolean bDeleteOnError, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1& featureDependencyErrors) – poojay May 23 '17 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.