|
||
| Inside Technique : Dynamic Menus UPDATE - January 30, 2000 Our original menu toolkit makes it easy to create static drop-down menus. Juan Romero created a modified version of our script where the menus are defined in an Access database and generating when the page loads. This approach allows you to define, modify, and update your menus without ever having to touch the HTML page. We are going to describe Juan's approach to managing and building the menus using Microsoft Access. The Microsoft Access Database has two tables - one containing the list of menu items, and a second table that defines the relationship between each menu item. This relationship defines the menu-hierarchy and (whether a menu-item contains a sub-menu with more choices). The menu items table is named
Below we create two sample entries:
This creates two separate menu entries, Links and SiteExperts.com. The next step is to specify
that the SiteExperts.com option is a sub-menu of the Links menu choice. This relationship
is defined in separate table named
To make the SiteExperts.com menu option a child of the Links menu option you need to add a row to this table. The ID field needs to represent the ID of the child (SiteExperts.com) and the parent field needs to represent the parent menu option (Links).
To create a top-level menu-item do not make the menu-item a child of any other item. Therefore, the Links menu option is not a child of any other menu-item. This table also supports nested menu items. For example, you can add your favorite SiteExperts.com links as children of the SiteExperts.com menu choice by adding them to to the items table and making SiteExperts.com's ID (58) the parent of those choices. By combining this access database with the modified script, your menus are all set to go. On the next page, you can download and view the complete script. Page 1:Dynamic Menus © 1997-2000 InsideDHTML.com, LLC. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||