For use in Microsoft Content Management Server, this Site Map web control, written in C#, displays channel and posting structure in a hierarchical tree that is expandable and collapsible when viewed in a IE4+ or NS6+ browsers. When viewed in NS4, the tree is fully expanded. The starting channel is configurable, so you can have multiple instances of the control in one page, rendering different portions of a site if so desired.
A VB.NET version of this control is available here.
The web control has several public properties:
StartChannelPath - Optional. Starting channel path. Default is "
ImagePath - Optional. IIS path to the three icons. Default is "
/<MCMS Site Application Name>/images/".
/<MCMS Site Application Name>/Includes/".
ExpandMap - Optional. Fully expand the channel and posting tree on first load. Valid values are
false. Default is
SortChildrenBy - Optional. Display order of channels and postings in tree. Valid values are "
Display Name", "
Name", and "
Ordinal". Default is no sorting.
ShowPostings - Optional. Display postings in the tree. Valid values are
false. Default is
DefaultPostingName - Optional. When
true and there is default posting for the channel, specify the default posting name to hide the default postings from the tree. For example, "
ShowDescription - Optional. Show channel and posting descriptions in hyperlink tooltips. Valid values are
false. Default is
MaxLevels - Optional. Show the specified number of channel levels only. Default is "
0" which shows all channel levels.
- Copy SiteMap.cs to the web control directory of your MCMS site.
- In your SiteMap template, register the control, include SiteMap.css, and insert the control. For example:
<%@ Register TagPrefix="wc1"
Assembly="Web Control Library Assembly Name" %>
href="/<MCMS Site Application Name>/style/SiteMap.css"
<wc1:SiteMap id="SiteMap" runat="server" StartChannelPath=""
ExpandMap="" SortChildrenBy="Display Name"
If your like the Expand All and Collapse All links as shown in the above picture, add links to the template like:
<a href="#" onclick="actionLayer(true);return false">Expand All</a>
<a href="#" onclick="actionLayer(false);return false">Collapse All</a>
media="all" attribute in the stylesheet reference. It prevents NS4 from reading it, as SiteMap.css is not compatible with NS4. If you don't care for NS4, you can also copy the content of SiteMap.css and add it into your site stylesheet.
Please check if there are any conflicts between your site stylesheet and SiteMap.css. For example, the sample site WoodgroveNet messes up the rendering quite badly.
- Copy channel.gif, channelopen.gif, and channelclosed.gif into the image directory as specified in the property
- Copy SiteMap.js into the directory as specified in the property
- Rebuild the solution in VS.NET.
- V1.0 - 2004.04.26 - Base.
- V1.1 - 2005.02.12 - Added an option to limit the channel depth. (Please note that the namespace and class names have changed.)
- V1.2 - 2005.03.13 - Added an option to show the postings in a tree. (Please note that the CSS class names have changed.)
- V1.3 - 2005.04.15 - Fixed
NullReferenceException when control is used on a non-template page.
- V1.4 - 2006.05.14 - Added an ASP.NET 2.0 version.
A Microsoft Certified Professional Developer and Technology Specialist.
Experience and expertise in SharePoint 2016 / 2013 / 2010 / 2007.
Role ranges from a developer in a multi-person team to a solution consultant with expert-level skills, leading a project to completion status.
Proven experience working effectively in a team environment and a self-managed environment.