Friday, 27 May 2011

SharePoint 2010: 'Hiding' Folders in a Document Library

One challenge we always face when working with clients is to respond to requests that don't use a technical solution exactly as it should be used. Case in point: a client is now working in a new SharePoint 2010 environment we're building out. They're working within a Document Library, and they want to hide a folder from view of (most) users. Not a problem. Use Permissions, right? Wrong. Client doesn't want to hassle with Permissions, but simply wants to hide a folder so only a few people who know about it can upload content to that folder by going directly there via a URL.
Check out the screenshots below.
I met the challenge by:
  • Creating a Folder Content Type called “Special Folder”
  • Creating a Site Column called “Hidden Folder” as a Choice list with “Yes” set as the Default Value
  • Attaching the Site Column “Hidden Folder” to the Content Type “Special Folder” (making it required)
  • Modifying the default View of the Shared Documents Document Library to hide the folder if the Content Type “Hidden Folder” is set to “Yes”.
This nets out to a simple scenario: The client can create a folder called “Special Folder” which will be hidden from being seen in the Document Library. The client can access the folder by opening the Document Library in Explorer view via an exact URL, the folder(s) can be seen and documents can be uploaded into the folder(s) but remain out of sight because the folders are hidden.
Not an ideal solution (Permissions would be a better choice), but it does satisfy the client need. Case closed? I hope not.
 Is there another (EASIER) way to do this?
VIEWS:
Standard Document Library (note there is no folder in view)

Creating the Site Column (Note that "Yes" is the default choice)

Creating the site column

Creating the Custom Content Type called Special Folder

Creating the Content Type

Viewing the Content Type settings (Note that the Site Column Hidden Folder is attached to this Content Type)

Custom Content Type




Creating a new Special Folder (Note that this folder will be hidden and will not appear in the Document Library)

Creating a New Hidden Folder

Creating a new Special Folder (Note that this folder will be hidden and will not appear in the Document Library)

Creating a new folder


Opening the Document Library in Explorer View (Note that we still don't see the new Hidden Folder)

Open with Explorer View

Hidden folder in Explorer view (Note that documents copy/pasted into this folder will not be visible in the Document Library view)

Hidden Folder in Explorer View

No comments:

Post a Comment