Logo 
Search:

MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Is it possible to delete the default document library template?

  Asked By: Mariah    Date: Apr 14    Category: MOSS    Views: 1472

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?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Tiana Whitaker     Answered On: Apr 14

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
{

}

 




Tagged: