Glossary Item Box

Navigator Control

Changing Selection Parameters

Structured Solutions

This document describes one of the techniques you can use to change which items are shown on the Navigator Control menu. The Navigator Control has several properties that can be declared on the control tag. The complete tag, with all the default values explicitly set, would look like this:

<sfaddons:Navigator
   id="Navigator1"
   runat="server"
   Depth="Tree"
   EnableCache="True"
   ExcludeCategories=""
   HighlightPath="False"
   ProductCategories="All"
   SortOrder="Ascending"
   TopCategory="0">
</sfaddons:Navigator>

All the basic properties are summarized in the table below:

Property Default Value Allowable Values Description
Depth Tree Branch or Tree A keyword that selects the depth of categories that are listed. When this property is set to Tree, then all the top-level categories and the entire branch to the current category are displayed. When this property is set to Branch, then only the current category and it's subcategories are displayed. If the current category does not have any subcategories, then the parent of the category is treated as the top category.
EnableCache True True or False A Boolean value that determines if the internal category data should be cached in application memory. If True, then the list of categories and product counts will not be updated until the application is restarted. The control will operate faster if caching is enabled.
ExcludeCategories null A comma separated list of categories to exclude This is a list of category ID's. Each category in the list will not be displayed. It will be as if the category did not exist.

Sample: "2,4,6"

HighlightPath False True or False A Boolean value that determines if the Navigator Control should select all the categories leading up to the current category. If this is set to True, then all the selected categories will be rendered with the corresponding selected template. If this value is False, then only the current category will be rendered with a selected template.
ProductCategories All All, First, Last, Longest, or Shortest A keyword that selects the categories that are expanded if the current category can not be determined. This can happen if you follow a link to a product detail page from off-site and the product is assigned to more than one category.
 
All Expand all categories that product is assigned to.
First Expand the first category (alphabetically)
Last Expand the last category (alphabetically)
Longest Expand the deepest category (the category with the largest level)
Shortest Expand the most shallow category (the category with the smallest level)
SortOrder Ascending Ascending,  Descending, or None Selects the order of categories in the list. Categories are sorted by name.
TopCategory 0 Any valid category ID You can select any category to be the top. The top category name is not displayed. All sub-categories of the top will be treated as top-level categories. This is especially useful if you add multiple copies of the Navigator control to the page with each one pointing to a different top category.

Example

In this walk through, we will modify the TextNavigator1.ascx user control only display the current category and it's children by setting Depth="Branch".

  1. Open Controls/TextNavigator1.ascx in an editor and add the Depth="Branch" parameter to the <sfaddons:Navigator> tag as shown in red (there may be other parameters in the tag that are not shown here):
    <sfaddons:Navigator
       id="Navigator1" 
       runat="server"
       Depth="Branch">
  2. Save your change and close the file.
  3. Copy TextNavigator1.ascx to the ssl/Controls directory.

Open a page of your store in a browser, select a category from the menu and notice that the menu only shows the current category and it's children.

 

 


Copyright © 2005 by Structured Solutions. All rights reserved.

Version 1.3.2