>This is the first in a regular series of guest posts. This post comes from Yaroslav Pentsarskyy who blogs over at Sharemuch. Watch out for more posts from a range of authors in the future.
Most users define which lists and libraries are there on the site by accessing All Site Content link. This is how most users see their lists and libraries of the default SharePoint 2010 team site.
|Above: The ‘All Site’ content view|
As you add more lists and libraries to the site, you can actually hide them from this view. This can be achieved pragmatically or using PowerShell. Here is the sample code which is used to show a hidden library:
using (SPSite site = new SPSite("http://[servername]"))
using (SPWeb web = site.OpenWeb())
SPList solutionGallery = web.Lists["Solution Gallery"];
solutionGallery.Hidden = true;
If you’re wondering what this library we have just made visible – it’s a Sandbox Solutions library; the place where users upload and manage sandbox solutions.
After running this code, the library will be visible along with all of the other lists and libraries. In your example, you might want to hide lists and libraries which are used for your core customizations. It’s important to understand that this will not make the list inaccessible to users, permission management will need to be applied on the library to actually prevent users from accessing the library. This functionality is for purely cosmetic purposes to reduce clutter on your site. Once hidden, the list will not be visible to many other office applications such as SharePoint Designer.
By the way, if you’re running SharePoint Designer, you can hide/un-hide a list by accessing it’s properties from within SharePoint Designer and selecting Hide this list from views