Introduction

Site Map Web Part displays structure of a Microsoft SharePoint Server 2010 site in a hierarchical tree that is expandable and collapsible. This web part is adapted from my SharePoint Server 2007 version.

Description

This Web Part uses a SiteMapProvider to render the site structure in a hierarchical tree that is expandable and collapsible. The SiteMapProvider is referenced from the site's web.config and is defaulted to be CurrentNavigation. In a publishing site, options to show subsites and/or pages are defined by each web's Navigation setting.

It has several public properties:

SiteMapProvider - (Site Map Provider) A site map provider that inherits from type SiteMapProvider defined in web.config. Default is CurrentNavigation.

StartNodeKey - (Starting Site URL) Server-relative URL for a starting sub-site.
For example: /sub2/sub21. Default is /, the root site. If set to blank, starting sub-site will be the current site.

ListCssClass - CSS class name for the outermost <ul> tag. Default is smwp-list.

CurrentNodeCssClass - CSS class name for the current node. Default is smwp-current-node.

The Web Part uses a resource file to store all messages and property attribute UI strings. It demonstrates how to develop a custom class that inherits WebDescriptionAttribute, WebDisplayNameAttribute or CategoryAttribute and returns a localized string from your own Resource Manager.

The supplied Visual Studio 2013 solution includes all the support files you need to build and deploy this Web Part, minus the strong name key file. It makes full use of the built-in SharePoint integration. No more third party tools or custom pre and post build scripts are needed to build the SharePoint solution file.

Installation

If you are upgrading from a previous version, please refer to Version History for any special upgrade instructions.

Go to SharePoint 2010 Central Administration/System Settings/Manage farm solutions. Deploy the installed solution to selected web applications. In the site collection where the solution is deployed, activate the Site Collection Feature Questech Systems Site Map Web Part. After that, the Site Map Web Part (listed under Questech Systems) should be available for you to add to pages.

Comments and Discussions

I did not see the ability on the SP 2013 page to post a question/comment so am hoping is ok to post here.

We have installed on SP 2013 and really like the web part. When you enable Managed Metadata Navigation on the site the web part is configured to it still continues to show the structural navigation. Web part is set to CurrentNavigationSwitchableProvider which should be correct to pull from the selected navigation.

Is there a way to display the Managed Metadata navigation? Perhaps I'm missing something on the configuration that is easy but not seeing?

We've taken a long look at the web part in my group and the Managed Navigation doesn't seem to work regardless of the setting. We've swapped out many of the Navigation providers and found the following

Switchable - simply reverts to Structural navigation regardless of the site setting configuration

Managed Navigation providers, current and global - these throw an object reference not set to an instance of an object

Lol, a developers favorite error message. We haven't gotten a chance to dig into the code or debug yet but wanted to see if you have any initial thoughts. Will keep you posted if we resolve and can contribute back.

[This thread is for the SharePoint 2013 version at Site Map Web Part (SharePoint 2013)] I am unable to reproduce the issue you are having. You could try testing it in an out-of-the-box publishing site collection to see if you have similar issue.

Your Article is Very Useful. I Have Developed HTML Web Site. I Will Started SEO Work On Web Site. I Try Created Site Map But I do not Know How To Created Site Map For My HTML Web Site? Please Suggest Me Proper Idea.

Looks great, and shows just what I was after - but not for our whole site, only for about half of it . . . is shows 82 separate items, but I know there are lots more subsites of the main site which it is just not getting to.Does it need time to trawl the whole site? Is there a limit to the number of items?And the order of the display looks slightly odd - does it do it in the order they were created, or???I'm puzzled, but I feel very nearly there!Bob

OK, so I actually got it working after a quick debugging session in Visual Studio (thanks for open source ).

The default setting for the "Include Sub Sites" property is "PerWeb" (the documentation also says this). A default SharePoint environment seems to exclude sub sites for navigation, so this setting basically prevents sites from being included in the site tree. Just set it to "Always" and the web part works again.

I am trying to use the site map webpart, which i downloaded from this site.

Could someone help me how I can apply css styles to this web part. I tried to set the ListCssClass and the required css was added to my custom css class, which the masterpage is using. However, I cannot see the styles being applied.

Before installing this web part on my site collection, my left nav menu items where the Title contained the "&" character were already being encoded by the provider.

After installing the web part, it seems like the PortalSiteMapProvider.EncodeOutput property has been reset and now my menu items with "&" are being double encoded, so that they render the following: &amp;amp; (where the first part - &amp; - is the newly encoded "&" from the original &amp; in the Title).