I received the following excellent question from Pankaj Joshi:
Is there a way to hide the built-in Document Library so that the user can only create a new document library only from Deleted Items Document Library (STS Web).
Which files do I need to modify for that. I tried to comment the entry for Document Library in create.aspx page but it didn't work. Do I have to modify some entries in files in 60\TEMPLATE\1033\STS\LISTS\DOCLIB
Please suggest.
I could be missing it, but there isn't any evident way to remove the built-in Document Library from the Create page of existing Web's/Area's. You will need physical server access to implement the following solution.
If you have implemented CustomJSUrl in a custom Site Definition as per my recommendations in the SharePoint Advisor magazine article then you can drop this code into the custom ows.js file and all Webs/Areas created using your custom site definition will hide this option on every create page.
try
{
//Used to remove the built-in Document Library from the Create page
var doclibLink = document.getElementById('onetCreate101');
if(doclibLink)
{
//There are three rows to remove from the DOM
//The row with the link in it and two blank rows that follow it
doclibRow = doclibLink.parentNode.parentNode;
doclibRowAfter1 = doclibRow.nextSibling;
doclibRowAfter2 = doclibRowAfter1.nextSibling;
//Remove all three rows from their parentNode (TBODY of the Table)
doclibRow.parentNode.removeChild(doclibRow);
doclibRowAfter1.parentNode.removeChild(doclibRowAfter1);
doclibRowAfter2.parentNode.removeChild(doclibRowAfter2);
}
}
catch(e){}
If you haven't implemented CustomJSUrl, you can still wrap this code in <script> tags and place it at the bottom of the Create.aspx page and the SPCreate.aspx page in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\1033 directory like this:
<script>
try
{
//Used to remove the built-in Document Library from the Create page
var doclibLink = document.getElementById('onetCreate101');
if(doclibLink)
{
//There are three rows to remove from the DOM
//The row with the link in it and two blank rows that follow it
doclibRow = doclibLink.parentNode.parentNode;
doclibRowAfter1 = doclibRow.nextSibling;
doclibRowAfter2 = doclibRowAfter1.nextSibling;
//Remove all three rows from their parentNode (TBODY of the Table)
doclibRow.parentNode.removeChild(doclibRow);
doclibRowAfter1.parentNode.removeChild(doclibRowAfter1);
doclibRowAfter2.parentNode.removeChild(doclibRowAfter2);
}
}
catch(e){}
</script>
HTH,
<Todd />