Per Location Views in SharePoint – Folder Metadata
This post applies to SharePoint 2007, 2010, 2013, and Office 365. This was written about 2007, but the same concepts still apply.
In SharePoint, there is a little known capability, called “per location views”. This means that you can create views that are only accessible from certain locations. In this context, “location” refers to a folder in a document library. Even though we (in the SharePoint community) keep saying “don’t use folders, don’t use folders”, I’m going to show you how this works… you know, just in case you happen to have folders in some of your document libraries. I really want to call this post “Folder Magic”
This example is of a company who owns and manages many different buildings, like apartments, office buildings, etc. Each building is represented by a folder in a document library (“Buildings”), and each building folder contains a standard set of categories, with a set of documents pertaining to each category. The categories in each building folder are: Field notes, Contracts, Photos, Reports, Budget. So, a column called “Category” has been created in the library, with these values.
What’s the goal? The goal is for a grouped view of categories to only be available after you’ve drilled down into the folder for a single building. Here are the steps, and you’ll get a better picture once you see the screenshots:
- In the “Buildings” document library, go to the document library settings, and click Advanced Settings. Change Allow management of content types to YES.
- Once you’ve done step one, go ahead and create a new standard view in your list and take a look at something. You’ll notice that in the “Folders” section of the view, there’s now an additional option to “Show this view” and pick where to show the view. That’s the gist of this blog post.
- That third option, to show the view “in folders of content type” by default only shows the one “Folder” content type. Next, we’ll be creating a new, custom content type to pick from. Go to Site Settings and Site Content Types.
- Click Create. I’m calling this content type “Building Folder” because a new folder will be created each time there is a new building that this company manages. The parent content type is Folder Content Types, and Folder.
- Next, I’m going to add a description field, so that each time a new folder is created, there can be a description associated with the folder. On the Site Content type screen for this new content type, under Columns, click Add from new site column. Call it “Folder Description”, as a Single Line of Text, and click OK.
- Go back to the “Buildings” document library, and to the document library settings. In the Content Types section, click Add from existing site content types.
- Add the “Building Folder” content type that was created at step 4.
- Now, since we’re using this custom folder content type, we don’t need that default one. Go back into the document library’s advanced settings, and change “display new folder…” to NO. Click OK.
- In the library, when I click the New drop-down box, I can now choose the “Building Folder” to create each folder:
- You can then modify the All Documents view, to add the “Folder Description” column. I went ahead and renamed it “All Folders” and set it to display only the Type, Name, and Folder Description columns.
- Create a new view. Call it “By Category”. Pick relevant columns, such as Name, Modified, Modified By, Checked Out To. In the Group By section, group it by the Category field mentioned at the beginning of this post. HERE’S THE MAGIC: In the Folders section, do this:
Setting up the view this way means that it will only show in the Views drop-down box when you’ve already drilled down into a building folder.
- This is what your grouped by view will look like:
- Another bonus regarding integration. Now, when I’m working on documents for one of these buildings while on the road, I can connect JUST THAT FOLDER to Outlook for work offline. Back at that top level in the library, click the drop-down box on a folder name:
This is very handy to be able to synchronize just one folder, instead of the whole library!
- BUT WAIT, THERE’S MORE! There is also the ability to control what options are available in the drop-down menu within each folder. Click the drop-down on a folder, see the screenshot above, and click Change New Button Order.
- Check it out, you can simply UNCHECK the folder content type! This way, users don’t have the ability to create any more sub folders under this folder. Awesome. It’s a pet peeve of mine when you have to drill down through multiple levels of folders in libraries.
- Also, you can set it up so that users can only create folders at the top level, and not documents. Go to the library’s settings page again. In the Content Types section, click Change new button order and content type. Uncheck all except the “Building Folder”. Click OK.
Think about it, you can even take this one step further. If each of these files for each building are pretty standard, you can create a content type for each type of file, so that they’re available on the NEW drop-down box. Then in scenarios (not this one) where you’d have files of each content type in each folder, you can select for ONLY that content type to be available in that folder. Have fun!
In SharePoint 2010, there is the concept of “Per Location Views” also, but the user interface is different, and the functionality is much improved. Jennifer Mason has blogged about it here: SharePoint 2010: Per Location View Settings
Interesting idea and I forgot about this little known feature. However I just find it overly complicated around the main problem which is information management. You go to extensive lengths here to organize information but IMHO I would just say slap a choice field on the list called Building Type with the values you want (or create different content types but that might be overkill). I’m missing the elegant option here. Why use folders when metadata gives you the same end result and seems to be easier? I know, it’s a discussion over beers or something but I’m not seeing the advantage here.
Bil, I agree I really just wanted to highlight a little-known feature. To me, the one real advantage of folders is being able to selectively connect folders to Outlook for working offline. If you didn’t have that as a need or requirement… then folders probably wouldn’t be necessary. I see SO many people still using folders, and insisting on folders. Maybe using some of the methods in this blog post, you could come to sort of a compromise, and only use, say, one level of folders.
As much as everyone “hates” folders I think they do have their place in v3 SharePoint. Another one of those “it sort of works in 2007” vs. “it’s much better in 2010” is the tree view for hierarchical navigation in document libraries. At least in 2007 you can have your folder hierarchy displayed via the tree view navigation. It’s not perfect but can sometimes help the transition for end users when a complete jump to “all meta-data, all the time” just won’t work. That said, I think the new and improved meta-data navigation in 2010 is a significant improvement…
Question for the ones advocating against folders – is there a way to have two documents with the same name (same file name) in a doclib without using folders?
Peter, No, there isn’t a way to do that. Why, and what would be the business case for that?
Peter, Question for the ones advocating FOR folders – is there a way to have a document exist in two folders? Folders still have their place, when they describe a unique, intrinsic, single-valued attribute of all files contained therein: – All Project Reports – All Meeting Minutes but not when they *try* to reflect multi-valued attributes: – All Project X Documents – All Project Y Documents Now where do I put that document (meeting minutes, multi-project review etc.) that refers to both projects?
Hi, What about permissions? Is the ability to assign permissions at folder levels a case for FOR folders? I have a document library for our IT projects. I am creating a new folder for each new project. Each of the project folders contains sub-folders for each phase of the project, Analysis, Design, Contracts etc… However after reading this blog, i have used the concepts explained here. Navigation is certainly much easier now. However, i am still wondering if i should continue to keep the folders (they are not visible to users anymore) as they serve the purpose of assigning permissions. E.g., the folders allow us to give access on a need to know basis. Business users involved in the requirements definition get access to Analysis folder, Contracts, not everyone should have access and so on. Would appreciate your thoughts on this scenario. thanks
Yes Zubairn, That would be a case to use folders, but just don’t use them too extensively. I recommend keeping it to maybe one level of folders with permissions. Beyond that, when you get to sub-sub folders and item permissions, it gets to be quite a hassle to manage.
All the pictures within this post are missing now… Would you please let me know where I could find them? I would really like to know the details about it.
oh yeah I fixed the pictures a while back. I also updated the title today, and added the fact that it’s applicable in other versions of SharePoint.