SiteMap
The Sitemap server control utilizes the folder breadcrumb information in the Workarea to display a sitemap of your site. By choosing the starting point of the sitemap, the max levels to display and applying a style class, you can customize the sitemap. The sitemap appears as indented list when viewed on a Web page.
The contents of the sitemap are defined on the Breadcrumb tab, located in the Workarea folder properties. See also: BreadCrumb.
Inserting the SiteMap server control onto a page
Prerequisite
You must have installed the server controls. See Installing server controls into Visual Studio Toolbox.
- In Visual Studio, choose View > Toolbox.
- Click the Ektron server control tab to display the server controls.
- Drag the SiteMap server control and drop it into the desired location on the page.
NOTE: You also can place the cursor on the page where you want the server control, then double click the server control that you want.
<CMS:SiteMap ID="SiteMap1" runat="server" />
- Click on
SiteMap
in the code to display and modify the control’s properties using the Properties window of Visual Studio. The page is updated as you modify the property values.
Sitemap properties
The following are Ektron-specific server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. properties. For information about native .NET properties such as font, height, width and border style, use Visual Studio® help.
- CacheInterval (Double)
The number of seconds that a server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified.’s data is cached. The default is 0 (zero). For example, if you want to cache the data for 5 minutes, set to 300. See also: Caching with server controls.
- ClassName (String)
The style sheet class name used to format the HTML. Leave blank to use the default. To use a new class, add it to
siteroot\Workarea\csslib\sitemap.css
. Then, add the class name to the property.IMPORTANT: Files stored in the
siteroot\Workarea
folder are overwritten (or deleted) when you upgrade. To avoid problems, back up the files to a folder outside thesiteroot\Workarea
folder. - DisplayXslt (String) (Code-behind only)
If desired, enter a relative or absolute path to an Xslt that determines the display of the page.
WARNING! Files stored in the
siteroot\Workarea
folder are overwritten (or deleted) when you upgrade Ektron. To avoid problems, copy the default file to a folder outside thesiteroot\workarea
folder then edit it. If there is no default file, create the file outside thesiteroot\workarea
folder. Next, in this property, enter the path to that file relative to the site root folder. - DoInitFill (Boolean)
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
- FlatTopLevel (Boolean)
When set to True, include site nodes from the parent folder but not their items. Set to False to include all nodes and items.
- FolderID (Long)
The folder ID for the starting point of the site map. To choose the root folder, enter 0 (zero).
- Hide (Boolean)
Hides or displays the output of the control in design time and run time.
- True. Hide the control output.
- False. Display the control output.
- Language (Integer)
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
- MaxLevel (Integer)
Set the maximum amount of levels to show. 0 (zero) = unlimited.
- StartingLevel (Integer)
Set to the starting level of the site map. If set to 0 (zero), starts from the root.
- Stylesheet (String)
Specify the path to a style sheet for use with this server control. Leave blank to use the default style sheet. To use a custom style sheet, place it in a folder outside the
siteroot\workarea
folder then edit it. Next, in this property, enter the path to the custom style sheet relative to the site root folder. - SuppressWrapperTags (Boolean)
Suppresses the output of the span/div tags around the control.
- True. Suppress wrap tags.
- False (default). Allow wrap tags.
- WrapTag (String)
Lets a developer specify a server control’s tag.
- Span (default). Designate an inline portion of an HTML document as a span element.
- Div. Apply attributes to a block of code.
- Custom. Lets you use a custom tag.
Using Sitemap
NOTE: Make sure you have added the sitemap information to your folders’ Breadcrumb tab in the Workarea.
To use the Sitemap server control:
- Open a Web form for which you want to create a sitemap.
- Drag and drop the Sitemap server control onto an appropriate location of the Web form.
- Add the starting folder’s ID to the
FolderID
property. - Set other properties. See also: Sitemap properties.
- Save the Web form.
- Open a browser.
- View a Web page with the Sitemap server control in it. The sitemap now appears on your site.
Retrieving the XML structure of a site map
Retrieving the XML structure of XML content allows for greater control over developing XSLs. The following is an example of how to retrieve the XML structure:
- Open a new Web form.
- Drag and drop a SiteMap server control onto it.
- Set the
FolderID
property. - Drag and drop a textbox on the Web form.
- Set the
TextMode
property to MultiLine.NOTE: It is also recommended that you set the width of the text box to at least 400px.
- On the code-behind page, add the following line.
Textbox1.Text = SiteMap1.XmlDoc.InnerXml
- Build the project.
- View the Web form in a browser. The XML structure of the Site Map appears in the text box.