How to create a document library template in SharePoint 2013 site definition?
In a site definition in SP2013, I want to create a document library template (not instance). I have this code in my `onet.xml`:

    <?xml version="1.0" encoding="utf-8"?>
    
    <Project Title="Mysite" Revision="2" ListDir="" xmlns:ows="Microsoft SharePoint" xmlns="http://schemas.microsoft.com/sharepoint/">
      <NavBars>
        <NavBar Name="SharePoint Top Navbar" ID="1002">
        </NavBar>
      </NavBars>
    
      <ListTemplates>
      </ListTemplates>
    
      <DocumentTemplates>
        <DocumentTemplate Path="STS" Name="" DisplayName="$Resources:core,doctemp_None;" Type="100" Default="FALSE" Description="$Resources:core,doctemp_None_Desc;" />
      </DocumentTemplates>
    
    
    
    
        <Configurations>
        <Configuration ID="0" Name="Mysite">
          <Lists/>
          <SiteFeatures>
          </SiteFeatures>
          <WebFeatures>
          </WebFeatures>
          <Modules>
            <Module Name="DefaultBlank" />
          </Modules>
        </Configuration>
      </Configurations>
      <Modules>
        <Module Name="DefaultBlank" Url="" Path="">
          <File Url="default.aspx">
          </File>
        </Module>
      </Modules>
    </Project>


After deploying, I was able to create a site with this site template, but then when I go into the create apps popup to create a document library, there is no options for document libraries at all...

Does anyone know whats wrong?

Thanks
August 27th, 2015 7:16pm

Hi,

According to your description, my understanding is that you want to add the document library template to site definition.

I suggest you can add the following xml into <Lists> tag :

<List FeatureId="00bfea71-e717-4e80-aa17-d0c71b360101" 
      Type="101" 
      Title="My Magical Document Library"
      Url="/MagicalDocLib"
      QuickLaunchUrl="/MagicalDocLib/AllItems.aspx" />

Here is a similiar thread for your reference:

Site Definition with Document library by default

Thanks

Best Regards

Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 5:23am

This just creates an instance of a document library. I want an actual template of a document library (Like I want to be able to create a document library from "add an app", but there is just 3 options "asset library", "access app", "import spreadsheet"). I want a document library to appear in this set of options.

There is this page

https://msdn.microsoft.com/en-us/library/aa978104%28v=office.12%29.aspx

Which says to do what I did, but it did not work.

I think the problem is that document templates are somehow not even enabled to appear in "add an app" page. If I can figure out how to do that, then this document template xml code might work.
  • Edited by sp.user 15 hours 14 minutes ago
August 28th, 2015 12:21pm

This just creates an instance of a document library. I want an actual template of a document library (Like I want to be able to create a document library from "add an app", but there is just 3 options "asset library", "access app", "import spreadsheet"). I want a document library to appear in this set of options.

There is this page

https://msdn.microsoft.com/en-us/library/aa978104%28v=office.12%29.aspx

Which says to do what I did, but it did not work.

I think the problem is that document templates are somehow not even enabled to appear in "add an app" page. If I can figure out how to do that, then this document template xml code might work.
  • Edited by sp.user Friday, August 28, 2015 4:27 PM
Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 4:20pm

Seems I needed to activate the team collaboration feature in manage site features. Then my initial code worked.
  • Marked as answer by sp.user 11 hours 6 minutes ago
August 28th, 2015 4:36pm

Seems I needed to activate the team collaboration feature in manage site features. Then my initial code worked.
  • Marked as answer by sp.user Friday, August 28, 2015 8:35 PM
Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 8:35pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics