Multiple Projects
DHTML Menu Builder offers two methods for implementing multiple navigation menus on the same page:
  1. By creating multiple toolbars on the same project
    • Pros: Easier to maintain and implement. Can control which toolbars to display using the Visibility Condition.
    • Cons: The compiled javascript files may become quite large. The use of the Visibility Condition requires a considerable JavaScript knowledge.
  2. By creating multiple projects and loading them simultaneously on the same page
    • Pros: A separate JavaScript file is created for each project so secondary JavaScript files will be quite small (around ~4KB each) . Also, only the necessary JavaScript files will be loaded when needed.
    • Cons: Complex installation process. Complex maintenance.

Before you decide to use one method or the other you should carefully consider the above mentioned pros and cons. The results are usually the same with both approaches, so try to determine which method will be more effective to meet your needs.

Note that the possibilities with DHTML Menu Builder are quite endless... and sharing multiple projects is one good example since you could even create a navigation system that uses both methods: sharing projects from multiple projects and controlling the visibility of some toolbars using the Visibility Condition.

You may also want to take a look at our online tutorial for implementing multiple menus available at:
http://software.xfx.net/utilities/dmbuilder/tipstricks/multimenus/

Introduction

Merging projects is the process of installing menus from several projects into the same HTML document or documents.
The way DHTML Menu Builder handles the use of multiple projects is by working with a master project and secondary projects (explained below). All the tools related to the compilation and implementation of the menus have been enhanced to be able to handle the use of multiple projects.


In this small how-to you will learn the basics for creating, preparing and implementing a navigation system that uses two toolbars from two different projects:

Creating the projects
The first step is to create the projects that you want to merge together. Each project can have any number of toolbars and even completely different settings for their styles and special effects. However there're several important rules that you must follow:

  • Frames are not supported when sharing projects. So none of the project should have the Frames Support enabled.
  • All projects must use the exact same type of configuration and their default configuration must be identical; that is, all the paths must point to the exact same location.
  • Each project must have a completely different name for their compiled files. To change the name of the compiled files click File->Project Properties->Advanced and use a different name for each one of the projects.
    If you don't change the names of the compiled files, DHTML Menu Builder will randomly select different file names when your compile.
  • If one or more secondary projects use toolbars, the master project must have, at least, one toolbar. If your master project does not require a toolbar then you can create an empty toolbar and then set its "Visibility Condition" to false to keep it hidden. To do so, click Menu->Add Toolbar to add the toolbar to the project, then, right click the toolbar and select Properties. Go to the Advanced tab and type this on the Visibility Condition textbox: return false;
  • Only projects created with version 4.1 (and above) can be used as secondary projects.

Defining a master project
A master project is a project whose menus are always going to be available. This project is the one that will always be included into all the documents of your web site. This is the project containing all the code to handle its own menus and the menus from all the secondary projects.

Any project can be the master project, so always try to select the project whose menus are going to be common to all the sections of your web site.


Defining the secondary projects
The secondary projects are those projects that are going to be combined with the master project.

To define the list of secondary projects click Tools->Secondary Projects
Use the Add button to add projects and use the Delete button to remove projects from the list.

Press the OK button when you're done defining the list of secondary projects.

NOTE: Only projects created with DHTML Menu Builder 4.1 (or above) can be used as secondary projects.


Compiling the projects
To generate all the .js files for the master and secondary projects simply click Tools->Compile

NOTE: DHTML Menu Builder will automatically save your master project before starting the compilation process.


Installing the Menus
To install the menus click Tools->Install Menus
The Secondary Projects dialog will be displayed so you can select which combination of projects you want to install.
When done click OK

Then you will see the usual "Install Menus" dialog.
Select the documents that should receive the master project plus the selected secondary projects and click Install.

As you may have already guessed, you can repeat this process as many times as you like and each time selecting different sets of secondary projects. This will allow you to install different combinations of projects into different documents in your web site.
 
Related topics of interest: