11

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?

  • 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
9
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 !!!

  • Try editing the web part and setting the "Levels to show" to 1 under the "Content" section. ;) – Chiramisu Feb 3 '16 at 17:34
3

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.

3

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();
        }
    }

});

});

  • i want to get all the subsites under a sitecollection and if the subsites have further subsites and so on, i need to show it to the users.it can go upto more than 5 levels. is it possible with the above solution, style library and table of contents web part? – dasarp Oct 27 '16 at 14:08
2

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

0

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).

0

I'm using SP2013, and could not find a 'table of content' web part.

Here's a solution, using the Search Web part, which i followed and worked really well for me...

https://en.share-gate.com/blog/roll-up-sharepoint-2013-sites-using-search

  • Hi Ryan, and welcome to the community! We try to avoid answers which only provide a link to an external source. While the detailed source of an answer, when possibly citing something, is essential to have, the answer should still contain at least the main points in case the URL one day breaks. In this case, it could be summarized as e.g. "Use Content Search WP with a query which returns only sites below the desired site level, like this: path:"http://demo/projects" contentclass:STS_Web Site<>{Site.URL}. Details can be found <here>." – moe May 25 '17 at 5:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy