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 would have thought SharePoint 2010 still had a built-in webpart to display a list of subsites as I could in previous versions. I'm having great trouble finding it, though.

How does one display a list of subsites below a site?

share|improve this question
    
Thanks. I ended up doing the same and using a webpart from WSS v2 and it works just fine for my needs. Thanks. –  Corbett Jul 7 '10 at 17:50

6 Answers 6

SharePoint 2010 > Edit > Insert > Web Part > Content Rollup > Table of Contents

From here there are tons of options for appearance, sorting, levels to display.

Problem is, it shows lists, too. So if you don't want to see the lists you may have to delete them or hide them. And I've tried deleting these lists but they still appear in the TOC !!!

share|improve this answer

It should be available under view all site content. Other than that, I've just kept a webpart that I've had since the WSS V2 and SPS 2003 days which shows the full site collection hierarchy.

Another thing I've had in our environments since SP 2007 is by default, I don't use the OOTB site map providers. I have my own that I wrote that displays the full site collection navigation by default as the top nav.

I mentioned this in my blog here: http://www.thelineberrys.com/default-category/using-features-to-enable-drop-down-menus-in-team-sites-3.html

The code posted there is really old and I don't suggest using it as is, but it gets the concept across.

share|improve this answer

You can download a webpart for free at Sharepoint247.com that will list the subsites of the current site. Download Sharepoint Subsites Webpart

share|improve this answer

Sounds like you got this fixed, but you can also use the web service to grab all of the subsites (this will come back permission trimmed to only those sites the user has access to also).

share|improve this answer

you can use Table Of Contents webpart

share|improve this answer

For SharePoint 2013 you can also use "Table of Content" web part. As the previous answer resolves only half of the problem, below is the remaining bit. In order to customize "Table of Content" to remove lists, libraries, etc. you can use your custom xsl stylesheet (name it for example SiteLevelStyle.xsl).

Then:

  1. Add "Table of Content" web part to your page
  2. Upload SiteLevelStyle.xsl into Style Library (/Style Library/XSL Style Sheets/)
  3. Export Table Of Contents web part to a local folder
  4. Open web part file and specify property ItemXslLink value to /Style Library/XSL Style Sheets/SiteLevelStyle.xsl
  5. Upload the modified web part file and add imported web part on page

You can download an example SiteLevelStyle.xsl from here: https://gist.github.com/vgrem/10109436

All credits goes to the article here: http://sharepoint.aspcode.net/view/635399286724222582162388/how-to-display-structure-of-subsites-in-sp-2013

Also, you can use jQuery to customize look of "Table of Content". An example here: https://tommdaly.wordpress.com/2013/06/27/customize-table-of-contents-remove-libraries-navigation-headers/

code:

jQuery(document).ready(function () {
var url = window.location.pathname;
jQuery(".toc-layout-main .headermarker").each(function () {

    var result = jQuery(this).find("a").each(function () {
        var href = jQuery(this).attr("href");
        if (href.indexOf('BaseType') != -1) {
            var topNode = jQuery(this).parent().parent().parent().parent();
            if (topNode.hasClass("level-section")) {
                topNode.hide();
            }
        }
        else if(href.indexOf('http') != -1) {
            var topNode = jQuery(this).parent().parent().parent();
             if (topNode.hasClass("dfwp-list")) {
                topNode.hide();
            }
        }
    });

    if (result.length == 0) {
        var topNode = jQuery(this).parent().parent().parent();

        if (topNode.hasClass("level-section")) {
            topNode.hide();
        }
    }

});

});

share|improve this answer

Your Answer

 
discard

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