none
Is it possible to delete the default document library template?

    Question

  • My client wants their site owners to use a custom document library template instead of the default document library template when they create document libraries. 

    I added the custom template to the list template gallery, but users can still choose to use the out-of-the-box MOSS document library template.  Is it possible to delete the default, out-of-the-box document library template so that only our custom one can be selected when users create a doc library?

    Wednesday, July 22, 2009 10:05 PM

Answers



  • I think you can do it with a Feature. I'll look into that... but the following also works and sometimes can work where a Feature will not.

    The following “hack” is:
      - quick
      - easy
      - requires access to the web servers
      - not a form of security
      - and is not best practice!  (the next service pack could replace the create.aspx page)

     Note: this example hides "Wiki", "Survey" and "Sites and Workspaces".  Edit the line with "Wiki|Survey|Sites and Workspaces" to what you want to hide.

    Steps:

    • Go to your web server and to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS
    • Open create.aspx in your favoriate text / page editor. (I used Notepad)   BACKUP THIS FILE BEFORE EDITING!
    • Scroll to the end and past the following JavaScript just before the "</asp:Content>" tag.
    <script type="text/javascript" language="javascript"> 
      var x = document.getElementsByTagName("TABLE") // find all of the TABLEs on the page   
      var i=0; 
      for (i=0;i<x.length;i++) 
      { 
        if (x[i].className=="ms-itemstatic") //find the TDs styled for lists 
        { 
          if (x[i].innerHTML.match('Wiki|Survey|Sites and Workspaces')!=null)  // find the items to hide. 
          { 
            x[i].style.display='none' 
          } 
        } 
      } 
    </script>
    

    If you like to limit this to just for MySites then wrap the above in:

    if (document.location.href.match('/personal/')!=null)    //do this just for the mysites
    {  

    }


    Mike Smith TechTrainingNotes.blogspot.com
    Thursday, July 23, 2009 2:25 AM

All replies

  • Hi,

     

    The OOB document template is part of Team Collaboration Lists in Site Settings > Site Features.

    It could be removed from create page by deactivating the feature. However, other OOB list templates would also be removed from create page.

     

    If other OOB Team Collaboration Lists are essential to your business, I do not suggest you to deactivate Team Collaboration Lists feature.

    As a workaround, I suggest you to tell the users not to use OOB document library.

     

     

    Thanks for your understanding.

    -lambert


    Sincerely,
    Lambert Qin | Microsoft TechNet Managed Forum Support
    Posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, July 23, 2009 1:31 AM


  • I think you can do it with a Feature. I'll look into that... but the following also works and sometimes can work where a Feature will not.

    The following “hack” is:
      - quick
      - easy
      - requires access to the web servers
      - not a form of security
      - and is not best practice!  (the next service pack could replace the create.aspx page)

     Note: this example hides "Wiki", "Survey" and "Sites and Workspaces".  Edit the line with "Wiki|Survey|Sites and Workspaces" to what you want to hide.

    Steps:

    • Go to your web server and to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS
    • Open create.aspx in your favoriate text / page editor. (I used Notepad)   BACKUP THIS FILE BEFORE EDITING!
    • Scroll to the end and past the following JavaScript just before the "</asp:Content>" tag.
    <script type="text/javascript" language="javascript"> 
      var x = document.getElementsByTagName("TABLE") // find all of the TABLEs on the page   
      var i=0; 
      for (i=0;i<x.length;i++) 
      { 
        if (x[i].className=="ms-itemstatic") //find the TDs styled for lists 
        { 
          if (x[i].innerHTML.match('Wiki|Survey|Sites and Workspaces')!=null)  // find the items to hide. 
          { 
            x[i].style.display='none' 
          } 
        } 
      } 
    </script>
    

    If you like to limit this to just for MySites then wrap the above in:

    if (document.location.href.match('/personal/')!=null)    //do this just for the mysites
    {  

    }


    Mike Smith TechTrainingNotes.blogspot.com
    Thursday, July 23, 2009 2:25 AM
  • Thanks Mike, that is exactly what I was looking for!  
    Friday, July 24, 2009 2:02 PM
  • Hello, 

    I am also trying to customize the default document works pace.I have a requirement as follows

    When we create a document workspace from document library (click on title-> send to-> create document workspace) i don't want all the default templates.I just want Document library on the document workspace and all the other default templates like announcement,calender and everything should be removed. 

    Please suggest me on the above

    Thanks in advance

    Sanjeev Gautam

    Friday, April 27, 2012 7:06 AM