Blog Archives

Harness SharePoint Library and Folder Default Views to build more appealing solutions

Article Index

1. Introduction

Why use different default views based on navigation hierarchy?

What are the different levels that a default view can be set?

Caution: Per-location view defaults

2. Library default views

3. Folder default views

4. Custom Folder default views

5. Document Set (and Custom Document Set) default views

1. Introduction

This article describes the different methods and techniques available for configuring default views at different hierarchy levels (folder levels) within a SharePoint library. This article presents the options and how to implement them in SharePoint 2013. All options/settings discussed also apply to SharePoint 2010.

Why use different default views based on navigation hierarchy?

People use libraries for many different purposes. If you are storing different types of documents in a library (especially if you are using different content types) the properties (or columns) of information may be specific to the different types of items in your library. Allowing the default view to be set at different levels in the navigation hierarchy means that you can show the user views that are specifically customized for showing the data in that location.

This is really where all the action is at. We’re talking about what happens when the user navigates either from the root level of a library into a folder, or from a folder into a lower level folder. Usually we group items in folders for some logical reason, and based on that logic it is reasonable to expect that we might want to show a different view of the items in that folder.

We actually have a few options available to us at this level depending on the types of folders that have been implemented. Let me bore you with some details about folders that may assist with some of the terminology used through the rest of this article.

Folders are a content type in SharePoint. Through the SharePoint UI you can create your own custom content types that are based on the folder content type (I’ll refer to these as custom folder content types, or just Custom Folders). Then there’s Document Sets which are based on the folder content type (just like a custom folder content type) but contain a lot of extra intelligence that SharePoint gives you out of the box. In the same way you can create custom folders by extending the base Folder content type, you can also create your own Custom Document Set content types by extending the standard Document Set content type.

The techniques for applying a default view to a folder is different for Folders, Custom Folders, and Document Sets, so we will discuss them one at a time.

What are the different levels that a default view can be set?

Library (top level)

Folder

Custom Folder

Document Set

Custom Document Set

This article will go through each of these different navigation hierarchy levels and explain with examples how default views can be applied and what it looks like.

Caution: Per-location view defaults

SharePoint also has the concept of “per-location view defaults” which is part of the Metadata Navigation and Filtering feature. On the surface it seems that there is a big overlap between setting default at the different hierarchy levels (as I will discuss in this article) and the per-location view defaults (which claim to let you specify a default view to use at any level in the hierarchy). In reality the per-location defaults do not affect the default views used as a user navigates between folders. These per-location view default only apply if you select to open the location via the Metadata Navigation tree. This method has some fairly major caveats and I’d advise caution when using it to implement folder level view defaults. If you want to know more about this option please read SharePoint per-location view settings (capabilities, limitations & pitfalls)

2. Library default views

This one is as simple as it gets. Every list or library in SharePoint contains one or more views. One of those views can be set as the default. You do this directly on the view settings page.

Open the library and select Library Settings

image

Scroll down to the Views section, where you can see all views for the library and also which view is currently set as the default.

image

To change the default view, click the name of the view you want set as the new default. This will open the view settings page. Now tick the ‘Make this the default view’ checkbox.

image

Save the changes and now navigate to the library in SharePoint and this time your selected view is displayed by default.

image

3. Folder default views

When to use it

Use this method when you want to show one view in the root of the library (when not in any folder), and a different view when inside any folder within the library.

What it looks like

In this example I’ve added 3 columns to a standard Document Library (Project, Project Manager, Document Type)

image

In my library I have only folders at the root level of my library (no documents stored at this level) so I just want columns for the title of the folder.

image

When I go into any of the folders I want to see a different default view which shows me documents grouped by Project and also shows the Project Manager and Document Type.

image

How to implement it

Ensure content type management is enabled for the library. This is under Library Settings | Advanced Settings.

image

Create a view to use at the root (top-level) of the library, selecting the desired columns, sort order, etc. I’ve called mine ‘Library View’. The important steps here are to:

1 – Set this view as the default view

image

2 – Expand the Folders setting option and select ‘Show in this view: In the top-level folder’. Note: these options only become available once you have enabled management of content types in the library.

image

Now save the view and the library view settings should look similar to this:

image

Notice that Library View is designated to only show in Top-level and is set as the default view for the library.

Now create another view that you want to use to display documents when inside folders. Again create the view and setup the desired column, grouping, sort order etc. I’ve called mine ‘By Project’. Important steps here are:

1 – Set this view as the default view. Yes I agree this doesn’t seem right. You would expect this to replace the ‘Library View’ as the default view – but in combination with the ‘Folders: Show in’ option some unexpected magic happens! Read on.

image

2 – Expand the Folders setting option and select ‘Show in this view: In folders of content type [Folder]’

image

Now save the view and take a look at the view settings for the library.

image

SharePoint has allowed us to have 2 default views! The show in column tells us that the ‘Library View’ view is the default for the Top-level (or root) of the library and the ‘By Project’ view is the default when in any Folder.

That’s it – when you now navigate to the library you will see the ‘Library View’ and then clicking to navigate inside a folder will automatically switch to the ‘By Project View’.

I was interested to see what would happen if I created another view at the “Show in folder” level and tried to set it as the default. I created a view called ‘By Manager’ and set it as default.

image

As you can see SharePoint is enforcing that I can only have 1 default view at the folder level and this is independent of the default view at the Top-level.

4. Custom Folder default views

When to use it

Use this method when you want to be able to specify a default view at the root level of the library, and a different default view for each type of custom folder. Your intended design might not use custom folders, but consider using them so that you can use the different custom folder types to assign different default views.

What it looks like

I have created a library to hold employee timesheets and expense claims. Timesheets and Expenses are two separate content types that I have created. I want to create a folder per project in the library, and within each project I’ll create an Expenses folder and a Timesheet folder to store the actual documents. Since Expenses and Timesheets contain different columns I want a specific default view when browsing inside Expense folders and a different default view when browsing in Timesheet folders.

image

With the use of custom folder content types I can have a default view at the library level showing detailed folder information (as shown below)

image

Then the default view is changed when browsing into any of the Timesheet folders to present Timesheet specific information (such as Week Start Date, Employee Name and Total Hours) in a nice friendly format.

image

A different default view is used when browsing into any of the Expense folders so you can quickly see Expense specific information such as the Total Amount of the expense.

image

How to implement it

Ensure content type management is enabled for the library. This is under Library Settings | Advanced Settings.

image

Before configuring the library we need to create some custom folder content types that we will use in the library. Management of content types is done at the site level (Site settings | Site Content types)

image

Create a new content type for the custom Timesheet Folder, setting the parent content type to ‘Folder’.

image

Save the new content type, then add the existing Comments site column to this content type

image

Select the Comments column so that our content type now has these columns

image

Create a second custom folder content type for the Expenses Folder, setting the parent content type to ‘Folder’.

image

As with the Timesheets Folder content type, go ahead and add the Comments column

image

Now in the library settings we need to add the two new custom folder content types

image

Select the Timesheet Folder content type and the Expenses Folder content type

image

Your library setting should look similar to this

image

Now we need to create the view we want to use as default when browsing in Timesheet folders

image

Similarly we need a default view to use for showing Expenses

image

To get the default view applying to folders based on the custom content type of the folder, we go into the view settings for the view you want to make a default. So let’s start with the Timesheets by Week view.

Check the ‘Make this the default view’ checkbox

image

Expand the Folders setting option and select ‘Show in this view: In folders of content type: Timesheets Folder’

image

Then edit the Expenses by Project view. Check the ‘Make this the default view’ checkbox

image

Expand the Folders setting option and select ‘Show in this view: In folders of content type: Expenses Folder’

image

After making these changes the Views section of the library settings should be similar to this

image

Notice the All Documents view is set to Show In All. In this state you will find that the All Documents view will be the default (even within Timesheet and Expenses folders). We need to change the All Documents view so that it only used as the default at the top level.

Edit the All Documents view, expand the Folders setting option and select ‘Show in this view: In the top-level folder’. The View settings should now look like this.

image

Enough configuration, let’s start populating the library now. First we will setup the folder structure.

At the top level of the library we create Project folders using the regular Folder content type

image

image

Within each of these project folders, we create one Timesheets folder (using the Timesheet Folder content type) and one Expenses folder (using the Expenses Folder content type)

image

Inside the Project ABC folder, I now have these 2 folders.

image

Browsing to these folders now you should find that the default view is changing automatically as you navigate.

Library root/project subfolders (use All Documents view)

image

Expense Folders (use Expenses by Project view)

image

Timesheet Folders (use Timesheets by Week view)

image

5. Document Set (and Custom Document Set) default views

When to use it

Use this method when you are using Document Sets in your library and you want one view at the root level of the library and a different view when you are viewing the contents of a Document Set. The same default view will be used for all instances of the Document Set within the library. If you have multiple different Custom Document Set content types in the library, you can specify a different default view for each of the different Custom Document Sets.

What it looks like

When browsing the root level (top level) of the library the All Documents view is used by default

image

Navigating into any document set switches the default view so that we can present the document properties in a better way.

image

In the case of multiple Document Set content types you can have a default view at the top-level (customized for showing information about the document sets) then have a different default view for each of the different document set content types. In the following example I have a library with 2 custom document sets (Small Project Document Set and Large Project Document Set).

The default library view shows a list of all document sets (includes both Small Project and Large Projects) and exposes specific document set properties as columns and groups by Project Status

image

When navigating into the first project (which is an instance of the Small Project Document Set) I get a default view customized for small projects

image

When navigating into the second project (which is an instance of the Large Project Document Set) I get a default view customized for large projects

image

How to implement it

Ensure content type management is enabled for the library. This is under Library Settings | Advanced Settings.

image

From Library Settings click Add from existing site content types

SNAGHTML1e60fc2

Add the Document Set content type

image

Once you’ve created your document sets (at least a few to start with), configure the All Documents view to display document set information that you want to see.

Next create a new view to use when showing the content of a document set (I called mine Document Set View)

image

Select Library Settings | Content Types | Document Set

image

Then select Document Set settings

image

Now use the Welcome Page View option to select your new view to show content within Document Sets

image

We are done, navigating into a document set should now use this view by default.

If you are using multiple custom document set content type, simply repeat the steps to assign Welcome Page View to each of the content types.

Further Reading

https://www.nothingbutsharepoint.com/sites/eusp/pages/automatically-switching-views-when-opening-a-sharepoint-folder.aspx

http://office.microsoft.com/en-001/sharepoint-server-help/configure-the-availability-of-views-for-a-location-in-the-site-hierarchy-HA010378684.aspx

http://sharepointpromag.com/sharepoint-administration/implementing-folder-content-types

%d bloggers like this: