In SharePoint 2007, it was possible to display any list or library from one site on another site in the same site collection, but to accomplish it usually entailed digging into SharePoint Designer and creating a data view web part. There was that little button when designing a data view web part, called “Connect to another Library”, which let you create a web part on one site, based off data in another site.
In SharePoint 2010, it is easy to put list or library data from a sub-site on a top level site in the same site collection, and it doesn’t entail creating any special web parts or breaking any pages off of the site definition! Here’s how:
- Open the browser and go to the list or library that you want to ultimately display on another site.
- Click the Library tab in the ribbon, and click the orange Edit Library button, to open it up in SharePoint Designer 2010.
- In the Views section on the right, click on the name of ANY view, to open it up. Yes any. It doesn’t matter which view you pick here. Don’t worry, you won’t be modifying this page.
- Put the cursor inside the content section of the list, so that the set of List View Tools tabs are displayed at the top.
- Click the Web Part tab. In the Save Web Part section, there are two options:
- To Site Gallery – This option is used if you want to have the ability to insert this list onto any site page in the whole site collection.
- To File – This allows you to save the .WEBPART file on your computer, so that you can import that file onto any page in the site collection.
- Click To File, and save it to your desktop. The following question pops up:
Do you want this Web Part to always show list data from the current web site? If you select No, the web part will show data from the list at the path ___, relative to the site in which it is used.
It is important to understand what this means. Click Yes to save this exact list. Click No, if you want this web part to be relative. So for example, if this is a list called Announcements, this web part would be used to display any list with the name Announcements that exists on the site that this web part is imported on. In this example, it’s a document library called Shared Documents.
- Click Yes.
- Close SharePoint Designer.
- Go to the other site, on which you would like to display this list. Click to Add a web part, and click the little Upload button below all of the categories of web parts. Upload the web part and add it to the page.
This is where the AWESOMENESS became apparent to me. Now a default view of the sub-site’s list will be displayed AND you can go into the web part properties tool pane and change the view. YES, the familiar Selected View drop-down and Edit the Current view button are both available… even though the list you’re viewing exists on another site!
BUG alert 1: Unfortunately, the functionality described in this blog post only works when you’re viewing a sub-site’s information on a top level site. This doesn’t work the other way around (top level list on a sub-site) because when you try to import the web part on the page you get an error.
BUG alert 2: When importing any web part on a page, the upload functionality is a bit funky in 2010. Sometimes you have to upload the web part twice before it will stick, sometimes some other site list gets added to the page, and every time you have to click to insert a web part at least twice. The first time to upload it (then the list of web parts goes away), then the second time to add that web part to the page.