1,804 articles and 14,530 comments as of Wednesday, January 26th, 2011

EndUserSharePoint has combined resources with NothingButSharePoint.com. You can now find End User (Mark Miller), Developer (Jeremy Thake) and IT Pro SharePoint (Joel Oleson) content all in one place!

This site is a historical archive and is no longer being updated. Please update your favorites, bookmarks and RSS feeds.

NothingButSharePoint.com
Monday, April 12, 2010

Per Location Views in SharePoint 2007

Author: Laura Rogers, Birmingham, AL
SharePoint 911

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:

  1. In the “Buildings” document library, go to the document library settings, and click Advanced Settings.  Change Allow management of content types to YES.
  2. 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.

  3. 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.
  4. 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.

  5. 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.
  6. 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.
  7. Add the “Building Folder” content type that was created at step 4. 
  8. 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.

  9. In the library, when I click the New drop-down box, I can now choose the “Building Folder” to create each folder:

  10. 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.
  11. 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:
  12.  

    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.

  13. This is what your grouped by view will look like:

  14. 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:

  15. This is very handy to be able to synchronize just one folder, instead of the whole library!

  16. 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.

  17. 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.
  18. 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

This article was originally posted on Laura’s Blog.

Author: Laura Rogers, Birmingham, AL
SharePoint 911

 

Please Join the Discussion

10 Responses to “Per Location Views in SharePoint 2007”
  1. George W says:

    HS! Another winner!

  2. George W says:

    OK Now that you’ve shown us how to use something we’ve been told not to use:

    What is the advantage of this over a non-folder, pure metadata-based grouping?
    – is it that the files themselves (within folders) won’t overwrite each other even if they have the same names (so you could have ‘Contract Details.doc’ for each building.. ?

    Could you have a set of ‘default documents’ in a default folder and copy it via Explorer view to create ‘blanks’ for a new building?

  3. Laura says:

    George,
    In that case, instead of putting a bunch of blank files in each folder, you could use a content type for each type of file, such as “contract details.doc”. Then, it’s just a user training issue, showing them how to use the “new” drop-down box, and letting them know if there’s a certain file naming convention.

  4. Diana Forman says:

    Laura,
    Very helpful for the type of documents I’m working with. Appreciate the post.

  5. Diana Forman says:

    Laura,
    I finally started setting this up and it is brilliant! I have one problem: when I drill down into a folder it appears in ‘All Folders’ view, not ‘By Category’ view, even though I’ve made the ‘By Category’ view the default view in each folder. The people who will be accessing these documents will not be able to understand how to get the view that they need (no matter how many times they are shown how to do it). Am I missing a crucial step in the set-up process?

  6. Laura Rogers says:

    Diana,
    Sorry, no that’s just how it works. Frustrating, I know.

    • Bastiaan Kortenbout says:

      Diana and Laura,

      Please implement steps underneath to solve this issue:
      1. Edit your “All Folders” view, and select under the Folder settings “In the top-level folder”.
      2. Edit your “By Category” view, and make this the Default view.

      You would think that making the “By Category” view the default view, this will also apply when opening the Document Library. But it turns out that the “In the top-level folder” setting on the “All Folders” view overrules the default view (only on top level).

      Therefore, it can be accomplished to open with an overview of all Folders (including additional site columns), and when you drill-down into a folder, the Categorized view is used.

      With regards,
      Bastiaan

  7. Diana Forman says:

    Thanks Laura – appreciate the quick response.

Trackbacks

Check out what others are saying about this post...
  1. SharePoint Document Libraries and Horrors Oh My…

    I thought I would capture a few ideas around document libraries and share with the rest of the class…




Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!