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?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI 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?
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 !!!
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.
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:
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();
}
}
});
});
You can download a webpart for free at Sharepoint247.com that will list the subsites of the current site. Download Sharepoint Subsites Webpart
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).
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
path:"http://demo/projects" contentclass:STS_Web Site<>{Site.URL}
. Details can be found <here>."
– moe
May 25 '17 at 5:56