views:

520

answers:

1

I wonder if there is a way to hide some document library lists that are shown when the user navigates to the "All Site Content" page in SharePoint, and I wonder if there is a programmatic way to achieve this. (If possible using WSS).

I need to hide many lists from this view, these lists will be accessed from the links inside a link list (this link list is the only I want the user to see).

Any help will be appreciated.

+4  A: 

The SPList class has a Hidden property that will do exactly what you want.

In short, you could do something like this:

1. Open the Site collection (SPSite)
2. Enumerate throuh all sites (SPSite.AllWebs -> SPWeb)
3. Enumerate through all lists (SPWeb.Lists)
4. Locate the lists you want to hide (base on Title or other property)
5. Set the Hidden Property to true
6. Call SPList.Update() (important!)
Paul-Jan
Thanks a lot :)
dana_g