Skip to main content
Laura Rogers @WonderLaura

Laura Rogers @WonderLaura

Go Search
SharePoint911
Our Services
Training
Our Team
About SP911
Important Links
SharePoint 2010
Contact Us
  

SharePoint911 > Blogs > Laura Rogers @WonderLaura > Categories
Per Location Views in SharePoint 2007

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.
    image
  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.
    image
  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.
    image
  9. In the library, when I click the New drop-down box, I can now choose the “Building Folder” to create each folder:
    image
  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:
    image 
    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.
  12. This is what your grouped by view will look like:
    image
  13. 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:
    CropperCapture[70]b
    This is very handy to be able to synchronize just one folder, instead of the whole library!
  14. 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.
    CropperCapture[71]
  15. 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.
  16. 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.
    CropperCapture[72]

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


 

SharePoint URL Basics

In SharePoint, it often helps to know the basics of how things are structured, and what the standard syntax of URLs is.  When explaining concepts to newcomers, I often take for granted that URLs are obvious, but they’re not if you’re not used to paying attention to them.  In this post, I’ll quickly go over some basics of a SharePoint URL structure, geared toward SharePoint newcomers who want to become power users, or who want to have a bit more advanced knowledge of it.  The first couple of these, like web applications and site collections are really quite technical concepts, with managed paths and such, but I’m going to attempt to water-down and simplify it.

Web Applications:

The beginning of the URL indicates its web app.  It always starts with http:// and then there’s the name of your web app.  For internal sites, this name has most likely been registered in DNS by a System Administrator.  I’ll use the example http://intranet.contoso.com in this blog post, with Contoso being the company’s domain name.  Most likely if your company has MOSS, you’ve got at least two web apps.  Once for the main intranet, and one for the My Sites, such as http://my.contoso.com.

Site Collections: titlegraphic

A site collection can live at the root level of the web application OR can be at a managed path.  When a site collection is at the root of the web app, it’s simply http://intranet.contoso.com. BUT, if the site collection is at a managed path, it will be two levels below, like this: http://intranet.contoso.com/sites/marketing
In this example, the “sites” is the managed path.  (managed paths are set up by administrators in central administration)

Sub-Sites: titlegraphic

Sub-sites are created under site collections.  So, following the example above, a sub-site called “promos” may have the URL of:
http://intranet.contoso.com/promos

OR, it could even be
http://intranet.contoso.com/sites/marketing/promos

Site Collections and Sub-sites will also have something extra, the default.aspx.  This is the main landing page of the site.  So, the full URL of the first example would be:

http://intranet.contoso.com/promos/default.aspx

When sending people the link to the site, or for that manner, linking to it in any way, it is not necessary to include the default.aspx at the end.

Publishing Sites

When using MOSS publishing sites, there is a “Pages” library involved (see library URLs in the next section).  By default, the home page of a publishing site will be something like:

http://intranet.contoso.com/promos/Pages/default.aspx

Each time you click <Site Actions> and choose to create a new page on your publishing site, it automatically gets created in this Pages library, with the URL that you specify on the new page screen.  A new page called News on the same site will have a URL like this:

http://intranet.contoso.com/promos/Pages/News.aspx

Document Libraries: dlicon

The URL of a document library can sometimes be confused with the URL of a sub-site.  A library called “Presentations”, under the site called promos (in the first example of sub-sites), will have a URL of:

http://intranet.contoso.com/promos/presentations

But a document library does look a bit different, because of the view part of the URL, which I’ll get into in the Views section below, but here’s what the full URL of the default view of the presentations library would look like:

http://intranet.contoso.com/promos/presentations/Forms/AllItems.aspx

Within document libraries, the document URLs consist of the names of each document.  For Example, if I upload an Excel file called “Project Hours.xlsx” to my “presentations” library, the URL to that file is:

http://intranet.contoso.com/promos/presentations/Project%20Hours.xlsx

Lists:generic

Lists actually do live under a folder called “Lists” in each site, so they’re easy to identify.  A list called “budgets” will have a URL of:

http://intranet.contoso.com/promos/Lists/budgets

And yes, there will always be that default view when you create the list, so the full URL will be:

http://intranet.contoso.com/promos/Lists/budgets/AllItems.aspx

RANT: Notice that there are no strange characters anywhere in these example URLs.  Those little %20 thingies are a major pet peeve of mine.  Each time I create new lists, libraries, views, and even columns, I never use spaces or apostrophes or any weird characters like that.  This makes the URLs ugly (in my opinion).  It does take a few extra seconds of time, and a few extra clicks, but I make it a habit to first create the object with no spaces, and save it, and then go right back in and rename it.  Since the URL is tied to the original name of the list or column or whatever, it will be nice and neat.

Views:

Views in lists and libraries each have their own URL.  When I showed a customer the other day how to create a filtered view in a list, grab the view’s URL, and then use it elsewhere in the site to link directly to that filtered view, this customer thought that was the coolest thing ever.  Basically, each view is a .ASPX file under the URL of the list.  In libraries, there is a “Forms” folder, as you may have noticed in the example above, and in lists, there is no “Forms” folder.  But lists do have that “Lists” folder that exists before the name of the list, as shown above.  Anyway, so for example a tasks list in SharePoint has several default views, each with their own URL, as so:

http://intranet.contoso.com/promos/Lists/Tasks/AllItems.aspx
http://intranet.contoso.com/promos/Lists/Tasks/active.aspx
http://intranet.contoso.com/promos/Lists/Tasks/byowner.aspx

Items:

Each individual item has its own URL, based on the type of form you want to open it in.  There are three default forms in SharePoint:

  • NewForm.aspx – This is the very first form that is used, when creating a new item in a list.
  • DispForm.aspx – This is the display form, to simply display the item after it has been created (as opposed to editing it)
  • EditForm.aspx – This is the form used to edit an item and then save it again.

Another important thing to know, is that every list and library item in SharePoint has its own unique ID, which is unique within that list or library.  The ID is called “ID”, and is created in numerical order as each list item is created.  This ID cannot be changed.  Here is the syntax of the page on which you create a new task in a task list:

Here is the syntax of the very first task created in a task list:

http://intranet.contoso.com/promos/Lists/Tasks/NewForm.aspx

Here is the syntax of the very first task created in a task list, AFTER it has been created, when you’re simply viewing it:

http://intranet.contoso.com/promos/Lists/Tasks/DispForm.aspx?ID=1

Notice that the New Form doesn’t have an ID associated with it.  There is no ID, because the item hasn’t actually been created yet.  It’s not created until you click OK that first time.  Then, when we click “Edit Item”, this is the URL for that same first item (ID=1) that we created in the list:

http://intranet.contoso.com/promos/Lists/Tasks/EditForm.aspx?ID=1

Source:

But Laura, what’s all that &Source=BlahBlahBlah stuff at the end of URLs?

The source is where you’re going to be navigated back to, after the form is filled out, and it’s usually where I came from.  Like what view I was looking at when edited the form.  In this example, I was looking at the “By Owner” (byowner.aspx) view of the tasks list when I clicked to edit an item, and starting with the ampersand, this is what the URL looked like after the editform.aspx?ID=1

&Source=http%3A%2F%2Fintranet%2Econtoso%2Ecom%2Fpromos%2FLists%2FTasks%2Fbyowner%2Easpx

In one scenario, I used this source stuff to my advantage.  I wanted the users to be navigated to a specific URL of my choosing after they filled out a certain form, so I created manual links in this certain site, all hard-coded with the Source information.

GUID:

Oh yeah, I went there.  In each SharePoint site collection, each list and library has a long unique ID.  This does exist in URLs in some places, like list settings.  For example, on a tasks list, I click to go to the list’s settings page, and the URL (after the name of the site) looks like this.  I’ve put the GUID in bold:

/_layouts/listedit.aspx?List=%7BD535FA0E%2D67A6%2D4182%2D9E6A%2D9513B06FB28A%7D

Therefore, when I go to the site here, and decode the URL, I get this:

{D535FA0E-67A6-4182-9E6A-9513B06FB28A}

Okay, okay, I’ll stop.  This post isn’t geared towards developers, so I’m not going to get any more into the nitty gritty here.  I guess if you want to know more about the GUID, you’ll let me know.  ;-)

Hopefully, this has been a helpful and explanatory crash course for SharePoint newcomers who would like to get up-to-speed.

 

Technorati Tags: ,,,
“Data View Preview” in SharePoint Designer 2010

When editing a data view in SharePoint 2010, using SharePoint Designer 2010, on the <Design> tab, there’s a section called <Preview>.  This title is a little misleading, because there are some pretty powerful options in this section, having to do with inline editing.  Jennifer Mason wrote about “SharePoint 2010- Inline Editing for Views”, which shows how to set up a list or library view with inline editing.  As is apparent, the view does not need to be created in SharePoint Designer in order to use inline editing, it can just be a regular browser view.  In this post, I’ll describe a way to create a data view web part using SharePoint Designer 2010, and some extra functionalities that exist when inline editing is used.

  1. Open the SharePoint 2010 site in SharePoint Designer 2010.
  2. Click “Lists and Libraries” on the left side of the screen, and then click on the name of the list or library to modify.  In this example, the list is called “Sales Report”. 
    CropperCapture[13]
  3. On the right side  of this page, in the Views section, click <New…> to create a new view.  I’m going to be creative and call mine “Custom” and click OK.
    CropperCapture[15] 
  4. Then, click the name of the view to edit it.  All list view web parts are data view web parts in SharePoint 2010, so there’s no worry about breaking the page away from the site definition at this point.
    CropperCapture[16]
  5. When any part of the list view in the middle of the page is selected, the contextual ribbon at the top of the page will display the <List View Tools> set of tabs.  On the <Options> tab, click the Inline Editing button.  This toggle button will insert a seemingly empty column into the left side of the list.  Again, Jennifer Mason’s blog shows examples of what inline editing looks like on a list item.
  6. Click on the <Design> tab, and now that inline editing is turned on, there will be a couple of more configurations possible.  In the Preview section of this tab, click the Data View Preview drop-down box.
    CropperCapture[17]
    The Edit Template and Insert Template choices are only available when inline editing is turned on.  
    Edit Template – This is the interface that displays in inline edit mode on any individual item in the list.
    Insert Template – This interface is used when the “Plus” CropperCapture[18] icon is clicked to add a new item to the list in an inline fashion.  Editing the insert template will change the way this screen appears. 

    These screens were not easily configurable in SharePoint 2007.
  7. There is another cool new option in this “Data View Preview” section, unrelated to inline editing.  This is the option to edit the ‘No Matching Items’ Template.  Back in the days of SharePoint 2007, when we wanted to change the text displayed when there were no items in a view, we could do only that… edit the text.  An example of a case in which to use this functionality:  There is a lit of tasks, filtered by tasks assigned to the logged in user.  Instead of the default “There are no items to show in this view…”, the text can be changed to something more specific, like “There are currently no tasks assigned to you”.  Now in SharePoint 2010, there’s the ability to edit that whole page that is displayed where there are no items in the view.  In the Data View Preview drop-down box, choose ‘No Matching Items’ Template.
  8. In this example, I edited the text, and also inserted an exclamation mark image.
    CropperCapture[21]
Alerts Based on Views

This is a "SharePoint Tip of the week" email that I sent out to our site administrators in November of 2007.  Thought I'd share it...

In SharePoint 2007, alerts can be set up based on filtered (specific) data, using views!

This applies to any SharePoint document library or list (contacts, calendars, tasks, etc.).  The following example will include how this is done on a document library with custom fields.

Example Case

n  An example hospital has different floors on their hospital.  They have created a new field in the Patient Admissions list called “Floor”.  Users are given a drop-down box of options for what floor a patient is admitted to.  Users would like to know if they can set up Patient Admissions list alerts so that they are only notified when patients are admitted to THEIR floor.  SURE THEY CAN!

n  First, the appropriate VIEWS need to be created, one for each “floor”.  Create 4 new views for: 1 North, 1 South, 2 North, 2 South

n  The first view will have a filter of: Show the items when column Floor is equal to 1 North
Create the other 3 views with filtering for each of their appropriate floor names

Creating the Alerts.

n  On the Patient Admissions list, click <Actions> and choose <Alert Me>

n  In the Send alerts for these changes section, choose the very last option called “Someone changes an item that appears in the following view

n  Then, in the drop-down box for that option, choose the name of the floor for which you’d like to receive alerts.

n  In summary, any data in any field of your list can be filtered into a View.  Alerts can be created based on any *filtered* view, even “Personal” views.

Oh, and another good way to use this feature would be on an Announcements list.  Each announcement would have a category, such as the department that the announcement is targeted to.  Create a view for each category.  This way, your users can set up their own alerts on the announcements list, and choose to only be alerted when a new one is added for their department.

Technorati Tags: ,