CMSSiteMap

The CMSSiteMap control allows you to display the whole navigation structure of the Web site or just its specified part. It reads CMS.MenuItem documents and renders their structure as a site map.

 

It allows you to display part of the menu structure specified using its path, depth, document type and WHERE condition. The items are sorted by MenuItemOrder and MenuItemCaption values.

 

See also: Using macro expressions in menu items

 

Inherits: CMSMenuProperties - common properties

 

Properties

 

Property Name

Description

Sample Value

UrlTarget

Specifies target frame for all URLs.

"_blank"

LoadDataAutomaticaly

Indicates if data for the control should be loaded automatically. By default, the data is loaded automatically.

 

If you set this property to false, you can supply custom DataSet to the DataSource property and then call the ReloadData(false) method.

 

RenderedHTML

Allows you to get or set the HTML code rendered by the control.

 

You need to set this property before the Render event - e.g. in the OnLoad event.

 

 

 

Methods

 

Method Name

Description

ReloadData

Reloads the data.

 

If the forceLoad parameter is set to false and the custom value is assigned to the DataSource property, the properties of the CMSListMenu control are not used and only the data from the DataSource are used.

 

 

Design

 

You can modify the design using the following CSS styles:

 

Class Name

Description

CMSSiteMapList

The UL element in the site map.

CMSSiteMapListItem

The LI element in the site map.

CMSSiteMapLink

Link (A element) in the site map.

 

 

Example

 

This example will show you how to display a site map based on the CMS content. It assumes that you have configured your project for Kentico CMS Controls.

 

Create a new Web form.
Drag and drop the CMSSiteMap control on the form.
In the HTML mode, add the following CSS styles inside the <head> tag. It will modify the appearance of the menu.
 

<style type="text/css">

.CMSSiteMapList { }

.CMSSiteMapListItem { list-style-image: url(images/menuitem.gif); }

.CMSSiteMapLink { color: #C34C17; text-decoration:none; }

</style>

 

Switch back to the Design mode.
In the Properties window, set the following property values:

     -Path: /%

Compile and run the project. You should see a page like this:

 

clip0040