Hide The Default SharePoint Content Libraries/Lists *HACK*

Recently for a client I created a custom Document Library that is specific to their organization. After creating it I wanted to hide the standard document library that comes with SharePoint. I don't want to delete it, just hide it so it can't be accidentally created. Here in lies my problem. I search high and low for a possible solution. While waiting to here back from the SharePoint blog team, I decided try and find a workaround. This is what I came up with. 

I decided to look at the actually aspx page that you see when you select "Create" from the site content area. I thought maybe I can hide the fields as they are created on this page.  The file is called "/_layouts/create.aspx" and can be found at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS". If you go down to line 158 you can see the code setting a string variable to the list template name. I found gold. After this line is where I inserted my nasty little hack.

//IF YOU WANT TO HIDE CERTAIN LIBRARIES FROM BEING AVAILABLE
if ((strTemplateDisplayName == "Document Library") || (strTemplateDisplayName == "Translation Management Library"))
continue;

This will hide the libraries from the view of the user. Just be aware that this might break if there is a Service Pack and/or Patch applied for SharePoint.

If you can shed some light on a better way please, let me know.

Published Thursday, April 30, 2009 10:21 AM by rojay12
Filed under: ,

Comments

# re: Hide The Default SharePoint Content Libraries/Lists *HACK*

Wednesday, December 21, 2011 3:02 PM by Jeremy

Did you ever find a more "standard" solution?

# re: Hide The Default SharePoint Content Libraries/Lists *HACK*

Friday, April 5, 2013 4:39 AM by Dow

Wow, awesome blog layout! How long have you been blogging for?

you make blogging look easy. The overall look of your site is magnificent, let alone the content!

# re: Hide The Default SharePoint Content Libraries/Lists *HACK*

Friday, April 12, 2013 7:48 AM by Rock

Heya i'm for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and help others like you aided me.

# re: Hide The Default SharePoint Content Libraries/Lists *HACK*

Saturday, April 13, 2013 12:33 AM by Irons

I was wondering if you ever thought of changing the layout of your

site? Its very well written; I love what youve got to say.

But maybe you could a little more in the way of content so people could connect with it better.

Youve got an awful lot of text for only having 1 or two pictures.

Maybe you could space it out better?