Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to have a list of all child sites on a page something like this:

  • Project 1
  • Project 2
  • Project 3

Where I worked before I ended up making a custom web-part to do this, and I'd rather not make a list that has to be manually updated.

Is there any way to do this in SharePoint Foundation 2010 automatically without having to make a custom web-part?

EDIT: This is exactly what data I want, but, I want that list view shown as a web-part, on another page. Can we do that without getting custom?

http://[YourSite]/_layouts/viewlsts.aspx?ShowSites=1

share|improve this question
add comment

2 Answers

You should check out a dataview web part. You can create a dataview web part using the GetSite method for the SiteData Web service. This will pull a list of all sites within the site collection for you.

share|improve this answer
    
Is this packaged with SharePoint Foundation? I'm more looking for a 'non-custom' solution. –  Hurst A May 20 '10 at 17:12
    
It is actually done from SharePoint designer. There is no coding required, but you do have to create the dataview web part from within that application. You would first create the data source as the web service, then just drag and drop it onto a page and change up the format the way you want it to look. –  Lori May 21 '10 at 13:33
add comment

The Data View Web Part (DVWP) has a DataSourceMode="Webs" that will return a data set containing all of the sites in the Site Collection. It's custom in the sense that you do the work in SharePoint Designer, but there's not server-side code.

Another option is to use my SPServices jQuery library and the GetAllSubWebCollection operation from the Webs Web Service. Here you'd just drop some script either into the page or in a CEWP.

share|improve this answer
    
I don't see this option when using SP Designer ontop of SharePoint Foundation either. All I see for datasources for a data view web part are my normal site lists. –  Hurst A May 20 '10 at 20:13
    
I haven't tried it in SharePoint 2010 yet, actually. But in SharePoint 2007, the DataSourceMode="Webs" option isn't exposed through SPD at all. You have to update the XSL manually. –  Marc D Anderson May 20 '10 at 21:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.