Skip to main content
Trans Am

Todd Klindt's SharePoint Admin Blog

Go Search
Home
Blog
Netcast homepage
SharePoint Terminology Wiki
  

Todd Klindt's home page > Todd Klindt's SharePoint Admin Blog > Posts > How to use SharePoint Designer to display list data from subwebs
How to use SharePoint Designer to display list data from subwebs

Recently on Twitter someone was asking about displaying blog posts from a subweb on the parent. This is pretty easy to do with SharePoint Designer (SPD) and its unsung hero, the Data View Web Part (DVWP). Here is a quick set of directions to get someone started. Once the DVWP is created any number of great customizations can be made. I'll leave that up for someone smarter than me. I'm not that good with DVWPs or SPD.

The first step is to create a new web part page in the parent site. The easiest way is through the Web UI. Log in as someone that can add content. Click Site Actions > Create:

You want to create a new Web Part Page.

Give the page a name and choose a template. For this I'll choose Left Column. You also need to choose where to create this page. I'll choose the Shared Documents Document Library:

After the page has been created, open up the root site in SPD. If you don't already have it, download the free trial. If you're doing any kind of SharePoint work, you need SPD. After SPD is open, open your root site's Shared Documents library and open the blogs.aspx page. A web part page should open up for you. Click the web part zone where you want the DVWP to go to give it focus. In my example I'll be placing the web part in the Body Web Part Zone.

Now go to the menu bar and select Data View > Insert Data View…

On the right hand pane the Data Source Library will be opened up. By default this will show all of the data sources in the current web at the DVWP can consume. Since the data we want is in a different web, we need to add it to the library. To do that click Connect to another library on the bottom:

When the Manage Library dialog box comes up, click Add. Give the library a name that makes sense to you. In my case I named it Blog. Under location type the path to the subweb that has your content. If you have opened this web in SPD previously you can also use the Browse button to find it.

Click OK a couple of times to get back to the Data Source Library. Now at the bottom of the list is an entry for the library we just added. Click the plus sign to expand the library. Blog posts are in a list called "Posts" so expand SharePoint Lists and click Posts. You should see a screen like this:

When you click Show Data your screen will change and you'll see the content of that list. To create the DVWP, drag the "Row [1/x]" line over to the Web Part Zone where x is the number of posts in your Posts list.

SPD will churn a little as it creates the DVWP. Once it's created it should look something like this:

Right now it's not very useful. The HTML isn't rendered correctly because of security concerns. Fortunately it's easily fixed. Click the first body entry to give it focus. Then click the > on the right side. Change the "Format as:" setting to Rich Text:

You'll get a prompt warning of the security concerns. Click Yes to clear it. Now all your blog posts will be rendered correctly.

That's where I'll stop for now. You'll probably want to alter how the posts are displayed. The web part as nearly infinite customization options like paging, sorting, grouping, the list goes on. To access them click the > for the web part and see the options there. Once you've done that you can also edit the HyperLink for the Title column to link users directly to the blog post. If there's enough interest I may do a blog post on that.

Have fun,

tk

 

Comments

Thank you

Nice post. Thanks for the tip. It's very handy.
at 1/19/2009 3:02 PM

What is my blog's URL?

Hi--I'm getting stuck at the part where you enter the URL in the "Collection Properties" ...have tried every permutation I can think of...help?

Mary (original "poser" of question)
at 1/19/2009 5:39 PM

Re: What is my blog's URL? Edit

How in the world would I know what your blog's URL is? :) You need to give the URL to the web of your blog. In my case the site collection URL is http://www.toddklindt.com and the subweb of that that houses my blog is http://www.toddklindt.com/blog. Not sure how those URLs are situated for you.

tk
Todd Klindt at 1/19/2009 7:28 PM

Love to see a follow up post!

Great post, that is extremely helpful!

I'm messing around with this a bit now and haven't had chance to do much customization yet, but I was wondering:

1.  Is it possible to aggregate data from multiple sub-lists in WSS 3?  Somehow join multiple data sources?

2.  Would it be possible to create a new column in a sub-list ("Display on top-site") and then if that column was checked that would be a filter/parameter criteria for the aggregate list to know if it should display that list item or not?

Basically to provide an aggregated calendar that displays multiple events from many sub-lists?

at 1/20/2009 9:30 AM

Update combined list with another site

I have joined multiple web site lists together into one master with filters and layouts etc as required.  However, I have more lists I need to add to this master.  I have updated the linked sources and can view the data.  Now I need the data view web part to update with the additional data.  Is there a quick way of doing this or do I need to rebuild the web part with the new data source?
at 2/3/2009 2:50 AM

Update combined list with another site - Part II

I have figured out the update for the combined list by adding new lists as a join to the initial combined linked source and not re-doing the initial linked sources.

However, if a user doesn't have access rights to any one list, you receive an access denied message, understandably.  Is there any way of having the lists link with a generic admin account but then still filtering the logged on user information?
at 2/9/2009 2:27 AM

What about going the opposite direction?

What if I have a List that is at the site root and trying to link down to a sub-site?  Just the opposite of your example?
at 4/6/2009 3:02 PM

Re: What about going the opposite direction?

Yup, you can do what you want to do. You can use a DVWP to display content from a parent web.

tk
Todd O. Klindt at 4/7/2009 9:05 PM

List Data with filtering

Hello,

Nice to see your post.
I have a query. Suppose I have t sub sites each having one list in it ex:
http://abc:123/site1
http://abc:123/site2
Now i want to display the data from these 2 sites (each list) on the root site http://abc:123/ with some sort of filtering. then in this case what can be done and how should i do it. please try to answer soon. Its my assignment.

Thanks in advance
Sumeet Gandhi
at 4/21/2009 9:08 AM

Link to list in another farm or on separate WSS

Does anyone here know if you can connect to a list on a separate WSS installation from a MOSS installation using sharepoint designer?
at 5/8/2009 3:04 PM

# Comments with link

Hi how do we get comments(10)  after Email this post ? link above.Please help me
at 6/23/2009 1:45 AM

Re: Link to list in another farm or on separate WSS

You should be able to connect to the web service URLs for a remote farm. It won't be exactly the same kind of connection, but it might work for what you're trying.

tk
Todd O. Klindt at 6/29/2009 3:51 PM

Re: # Comments with link

I'm not sure I completely understand your question. Are you asking how I got the # Comments column in the screenshots above? If so, you can get that by either dragging over the entire item (the highlighted item in screenshot #8) to the DVWP, or by dragging over the Comments column individually if you aren't using them all.

tk
Todd O. Klindt at 6/29/2009 3:54 PM

Number of items to display when showing blog posts

Hi Todd

Fantastic information - thank you very much. How do I limit the number of posts to show? I would want a maximum of 10 blog posts' info to be displayed. Where do I specify this?

Amy
at 7/4/2009 9:17 PM

Showing URL from a List

I am able to connect to a List from a parent site, however the URL column shows in the format or URL, Title.  How can I use it to properly contruct the URL?
at 8/10/2009 2:33 PM

Hi

I have created the blog site in my sharepoint intranet portal, now i want how can some one comment on the blog. If i open the site by administrator or any user having full rights to the sites then only post the comment appears otherwise not.
I want this should work for any one having read or view permissions.
at 10/14/2009 2:35 AM

Thank you

Excellent! I've been tearing my hair out all morning trying to do this.
at 11/27/2009 7:44 AM

How do you link the title in joined view to list item?

I have two lists that are joined.  Basically users from two sub sites are adding to one list.

From the list view, I want to be able to click on the title and go directly to the list item.

Right now the url path and path variables aren't working and since they are two different sources, I can't manually add the path. 

Any suggestions?  Thanks!
at 1/12/2010 2:39 PM

Web part page library?

Hello,
I am creating Sharepoint pages under a Sharepoint site. The page is a web part page template. I added my web parts by importing custom web parts so I could just insert tables and add links. Easy.

OK my question is this:
When my webpart page is completed, I want to duplicate this page SEVERAL times and rename the aspx files. I want to basically make many replicas of this page. I want to use this page as a template.

Someone told me I can make a Document Library and upload the web parts I want so that when I create new webpart pages from one of the 8 templates, I can just drag and drop them in there. I created the library and have found no such functionality except adding a web bart called Document Library that only lists the links to the files so this doesn't work.

I even tried downloading my page and uploading it into this document library but there is no button or command for copying the page when creating a new page. I am wishing for a "duplicate" button or "New from..." button that replicates the page.

Is there anything similar to this? Please help because I need to make many pages that are replicas of this page and don't want to have to make them one by one, adding the web parts to each one!

Thanks for your time and concern.
at 3/26/2010 12:28 PM

Re: Web part page library?

I'm not entirely sure I understand what you're trying to do, but here's a shot at an answer.

When you create a new web part page, you have to save it in a document library. Once you get the page set up the way you want it, open the document library up in Explorer View. When you do this you can copy the ASPX pages just like you would in Explorer. You can even drag them over to othe SharePoint document libraries that are also opened in Explorer View.

Does that do what you need it to?
tk
Todd O. Klindt at 3/28/2010 11:44 AM

Sharepoint 2010

Hi,

i am working on a Sharepoint 2010 system and would like to know if anybody knows how this is to be done in Sharepoint designer 2010? I am Missing the connect to another Library Button.
I would be very glad if anybody could give me a hind.

Tanks
TB
at 4/8/2010 11:27 AM

Sharepoint 2010

How to do this in sharepoint 2010?????

can anybody help?
at 4/15/2010 12:26 AM

Works like a charm....

It worked great. I can even export the custom web parts that I just created using this tutorial.

QUESTION: I now have to take this web parts and deploy to another sharepoint site (test, qc, and production).

What all I need to change with this xml web part when I deploy it to different sharepoint site....
at 5/26/2010 12:21 AM

Connect to another library in Sharepoint 2010

How to do this in sharepoint 2010?
As it is missing Connect to another library link...
Please help...
at 6/1/2010 1:15 PM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Please enter today's date so I know you are a real person
Attachments