demo
templates
install
contact
Home Templates Menu Generator

Menu Generator Script

The menu generator is now universal (as of version 0.950) in that it can be set to different configurations as it is called in the template.

<?php
  $menuStyle = 'Vv';
    $menuSeparator = ''; // no separator
    $menuSpacer = ' '; // a space - allows menu word wrap
  include "$_SERVER[DOCUMENT_ROOT]/template/DefaultMenu.php";
?>

Where $menuStyle uses Uppercase letters for the main menu options, and lowercase letters for submenu options.
The meaning of the options letters:

V - Vertical Main menu
H - Horizonal Main Menu
v - vertical submenu
h - horizonal submenu
T - Main menu placed inside Table
t - Submenu in table
s - separate submenu

If you use the 's' option to separate the submenu from the main menu, you can place the submenu in your template with <?php echo "$subMenu"; ?> . Since the submenu may be separated from the main menu, it might be a good idea to repeat the selected main menu item near the submenu. Use <?php echo "$curMenu"; ?> in the template where you want the main menu entry repeated (it will be the same as the main manu link).

Option letters can be in any order. If no menu style is specified, a nested vertical menu is produced.

If 'display: block' is used in the style sheet (to produce a roll-over effect) use the menu options 'Hh', since the style sheet will handle making the menu into blocks.


Optional separator (between main menu entries) and spacer (between words in menu entries) can be specified:
<?php
    $menuSeparator = '<img src="/templates/blueline.gif" width="140" height="1" alt="" /><br />';
    $menuSpacer = '&nbsp;'; // to prevent menu word wrap
    $menuStyle = 'Vv';
    include "$_SERVER[DOCUMENT_ROOT]/template/DefaultMenu.php";
?>

The separator is blank by default, and the menu spacer ($menuSpacer) is set to a single space unless otherwise specified. If wrapping is not wanted, you can use a non-breaking space ('&nbsp;') instead.

Note that PHP requires double quotes around strings if there are variables that need to be processed (i.e. "$_SERVER...").
Single quotes (apostrophes) work best around literal strings of text that do not contain apostrophes.
Each line of PHP code must end with a semi-colon (;).