|
Details
WebMenu exposes a hierarchical object model to allow you to configure your menu. Sometimes, your application may need to manipulate these objects to customize the menu for your users. This is especially helpful if your menu is loaded from a *.wms file created with WebMenu Studio.
If you need to manipulate WebMenu’s objects, it is recommended that you use a recursive algorithm to perform the task. Recursive logic contains functions that call themselves, and are useful when navigating a hierarchy. It allows you to walk through the hierarchy in a clear and concise manner.
To demonstrate using recursion to navigate WebMenu, we wrote the following sample applications. They are written for JScript and VBScript. These samples create a WebMenu control, and load its state from a *.wms file. Then, they use a recursive algorithm to visit all the group and item objects contained in the control. To see the results, the caption properties are written to the page to build a basic site map. Download the sample |