
First, create a region in page.tpl.php. In the example below, the region is named $primary_nav. This region name will also appear in the template.php file. The division tag 'primarynav' is the CSS construct that is used to style the menu's. The CSS will only be applied to the block name, this will prevent all menu's being formatted the same.
<?php if ($primary_nav): ?> <div id="primarynav"><?php print $primary_nav; ?></div> <?php endif; ?>
In template.php, add the region 'primary_nav' and give it a name (below its name is 'Primary Links'). The name will be displayed in yellow on the Build Blocks page in Drupal.
function myTheme_regions() { return array( 'primary_nav' => t('Primary Links'), 'content' => t('Content'), 'rightsidebar' => t('Right Sidebar'), 'footer' => t('footer') ); }
In addition to this, for Drupal 5.x, include the primarynav.css and primarynav.js to template.php. I usually append the file with the following:
drupal_add_css(path_to_theme().'/primarynav.css'); drupal_add_js(path_to_theme().'/primarynav.js');
Alternatively, you can just copy/paste the contents from the primarynav.css file to your style.css. Adding CSS and JS files via drupal_add_xx() will add the files to every page-xx.tpl.php. Upload to your theme's directory: primarynav.css and primarynav.js.
Next, go to Build Blocks admin page and enable the menu you created by assigning it to a region named 'Primary Links' in the drop down selection. The default, if you haven't added a new menu, is named 'Primary Links' in the admin/build/menu page.
**Make sure the menu items have the 'Expanded' checkbox checked in all the Menus located in admin/build/menu.**
In summary,
References: A List Apart: Suckerfish Dropdowns
| Attachment | Size |
|---|---|
| primarynav.css | 4.64 KB |
| primarynav.js.txt | 474 bytes |