Please Note:
HierMenus is protected by copyright laws. Use of the HierMenus code requires a paid licensing agreement.
Click Here to Register

Site Navigation
Bulletins
About
Documentation
FAQ
Samples
Known Issues
Technology Jobs

internet.commerce

Partner With Us
Phone Cards
Cell Phones
Promote Your Website
Boat Donations
Corporate Gifts
Logo Design
Online Universities
Online Shopping
Auto Insurance Quote
Imprinted Gifts
Promotional Pens
Promotional Products
Corporate Awards
Televisions

          
internet.com

IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

 
HierMenusCentral Enhance the Functionality of Your Web Site with DHTML HierMenus.
    

home / documentation / setup / Using HierMenus with a Database

Using HierMenus with a Database

You can setup HierMenus to work in conjunction with a database. In order to do so, you must provide your own server side tool that translates the information you have stored in your DB into HierMenus' own configuration file format. You can then provide your dynamically generated configuration file to the page via whatever delivery method you prefer. As far as HierMenus is concerned, the only changes you need to make are in regards to HM's own loading of its execution scripts and configuration file. A basic understanding of the HierMenus loading process should help you to understand this point.

When we load HierMenus into a page, two main files are loaded: the menu execution scripts (represented in the HierMenus script directory as HM_ScriptDOM.js, HM_ScriptOPR.js, etc) and a configuration file that contains the menu definitions for the page. The Menu definition file is the one that would be of interest to you. Most often this file is defined as a static file by the site developer and remains in a fixed location on the server to be retrieved along with the Web page request from the site visitor. However, in some situations developers have opted to provide the configuration file dynamically using a server-side tool when specific pages are requested. This requires a small amount of editing to the HierMenus loading mechanism from you but is quite doable.

In other words, HierMenus builds all of the menus it needs for a page from the information within this menu configuration file; information that can simply exist in a single static location (file) or can be generated automatically within a specified page via some type of server control that you provide. While we definitely encourage them, we do not directly support such dynamic server-side HM deployments; i.e., we provide the menu configuration file documentation itself (see step 2 of the setup instructions, as well as the parameter reference) and leave it to individual developers (i.e., you) to create the menu definitions in a way that HM can utilize them in the same manner as it would the static files.

There are two main methods you can employ to get HierMenus to recognize your generated configuration file.

  1. Call it directly from HM_Loader.js
    This is the simplest of the options, but does require that your server side tool--the one that will generate the HierMenus configuration file from your DB information--must be independently executable; i.e., you must be able to access it directly via URL. Additionally, the tool must be able to directly provide the file's appropriate mime-type in the information that it sends to the browser. For JavaScript files, you can use a mime-type of application/x-javascript (more technically correct) or text/javascript. Either should work fine.

    To instruct HierMenus to "call" your dynamically generated file, simply include the appropriate URL in the HM_ConfigDir and/or HM_ConfigFiles parameters. HierMenus will then instruct the browser to retrieve your file in the same manner that it would retrieve a static configuration file from the server.

  2. Include it within the page
    This is the least desirable option, as it will require that all browsers download your configuration file, even if they won't actually be using HierMenus at all (such as older browsers, or browsers with JavaScript specifically disabled). But it may be the only option if you are unable to create a more directly accessible tool as in the first option above.

    When including the configuration file within the page, you must first instruct HierMenus to not retrieve a configuration file of its own, which you can do by setting HM_ConfigFiles and HM_ConfigDir to the empty string.

    Once you've cleared HierMenus' own configuration file load, you can then include your own generated content into your HTML page. As the information you generate relies on the execution scripts (also loaded from HM_Loader.js) you must include your server side command to generate your configuration file after the command to call HM_Loader.js.

    The configuration "file" you dynamically generate via your own server side tool must exactly match the configuration file format as specified in step 2 of our setup instructions. Additionally, since you are generating the file outside of HierMenus, you must be sure to enclose your results within valid HTML script tags. For example, your HTML page might look something like this:

    <script type="text/javascript"
            language="JavaScript1.2"
            src="/hm/scripts/HM_Loader.js">
    </script>
    <script type="text/javascript" language="JavaScript1.2">
    <?php 
       // insert php code to generate menu configuration file here
    ?>
    </script>

The deprecated language="JavaScript1.2" attribute is optional here, but we recommend it for best support of the oldest browsers.

For more information:

HM_ConfigFiles
HM_ConfigDir
Setup Instructions, Step 2



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
Created: 3/25/2004
Updated: 3/25/2004
URL: http://www.hiermenuscentral.com/documentation/setup/database.html