Usage Instructions
The examples below show various ways that the control can be used. Keep in mind that the levels can be styled however you want. These examples don't show different styles, just different types of information that can be displayed.
To use this control, simply add a call to [[ConLib:W2MCatalogTree]] to any of your sidebar
scriptlets that you would like this control to appear on. You can also add several optional
parameters to the control reference.
Summary: Displays a dynamic directory tree, including categories and optionally products,
webpages, and links. Also has controls to show product counts in category labels and
expand/collapse icons for nodes with sub-items.
Usage: [[ConLib:W2MCatalogTree BaseCategoryId="0" ShowCategories="true" ShowProducts="false"
ShowWebpages="false" ShowLinks="false" ShowProductCounts="true" ShowExpandCollapse="true"]]
Properties:
BaseCategoryId
The ID of the category to start the tree at. Default is the root category.
ShowCategories
Indicates if sub-categories should be shown.
ShowProducts
Indicates if products should be shown.
ShowWebpages
Indicates if webpages should be shown.
ShowLinks
Indicates if links should be shown.
ShowProductCounts
Indicates if product counts should be shown with categories. Note: Only displays product counts, not other catalog objects.
ShowExpandCollapse
Indicates if the Expand/Collapse icons should be displayed for categories.
For example:
[[ConLib:W2MCatalogTree ShowWebpages="True" ShowLinks="True"]]
Will show Categories, Webpages and Links, but will hide Products.
Calling the control like this:
[[ConLib:W2MCatalogTree]]
Is equivelant to:
[[ConLib:W2MCatalogTree BaseCateShowCategories="True" ShowProducts="False" ShowWebpages="False" ShowLinks="False" ShowProductCounts="True" ShowExpandCollapse="False"]]
If you open the control in Visual Studio you will have many other options for the control's appearance
and behavior, including:
Styles - Including fonts, colors, backgrounds, borders, expand/collapse graphics, etc.
ShowLines - Show or hide tree lines.
ExpandDepth - How many levels deep to have the control expand.
And many more!
Example 1 - Default Display
This is the default display. Starts at root category, shows product counts, has expand/collapse turned on, only shows sub-categories. Calling the control like this:
[[ConLib:W2MCatalogTree]]
Is equivelant to:
[[ConLib:W2MCatalogTree BaseCateShowCategories="True" ShowProducts="False" ShowWebpages="False" ShowLinks="False" ShowProductCounts="True" ShowExpandCollapse="true"]]
Example 2 - show products, show webpages
Starts at root category, shows product counts, has expand/collapse turned on, shows sub-categories, products and webpages. Call the control like this:
[[ConLib:W2MCatalogTree ShowProducts="True" ShowWebpages="True"]]
Example 3 - start category 2, product counts off
Starts at category 2 (our Add-Ons category), hides product counts, has expand/collapse turned on, shows only sub-categories. Call the control like this:
[[ConLib:W2MCatalogTree BaseCategoryId="2" ShowProductCounts="false"]]
Example 4 - start category 30, product counts off
Starts at category 30 (our Training & Support category), hides product counts, has expand/collapse turned on, shows sub-categories and webpages. Call the control like this:
[[ConLib:W2MCatalogTree BaseCategoryId="30" ShowProductCounts="false"]]
Example 5 - start category 30, product counts off, webpages shown
Starts at category 30 (our Training & Support category), hides product counts, has expand/collapse turned on, shows sub-categories and webpages. Call the control like this:
[[ConLib:W2MCatalogTree BaseCategoryId="30" ShowProductCounts="false" ShowWebpages="True"]]
Example 6 - start category 30, product counts off, webpages shown, expand/collapse off
Starts at category 30 (our Training & Support category), hides product counts, has expand/collapse turned on, shows sub-categories and webpages. If you notice, this is the same as Example 5, however since Expand/Collapse is turned off you can't see the webpage listings under the sub-categories. Also, unlike Examples 4 & 5, the Site & Hosting Support sub-category can't be expanded. Call the control like this:
[[ConLib:W2MCatalogTree BaseCategoryId="30" ShowProductCounts="false" ShowWebpages="True" ShowExpandCollapse="False"]]
Example 7 - start category 30, product counts off, webpages shown, expand/collapse off
Starts at category 30 (our Training & Support category), hides product counts, has expand/collapse turned on, shows sub-categories and webpages. If you notice, this is the same as Example 5, however since Expand/Collapse is turned off you can't see the webpage listings under the sub-categories. Also, unlike Examples 4 & 5, the Site & Hosting Support sub-category can't be expanded. Call the control like this:
[[ConLib:W2MCatalogTree BaseCategoryId="30" ShowProductCounts="false" ShowWebpages="True" ShowExpandCollapse="False"]]