Adding Nice Menus Support

Nice Menus is a lovely module that extends the Drupal menu system so that it allows drop down and collapsing menus.

The default recommended way for using menus is to use blocks, and Nice Menus is very easy to configure as a block. However, if you've already built your page using a Zen subtheme and the main menu system, or you categorically feel that blocks are not the way to go for your site, then you need to change the page generation code in your subtheme. This little guide mentions the steps necessary to enable Nice Menu support on your Zen subtheme on the Drupal 7 series.

Menu items that are not links

Drupal's menu system lets you define an arbitrary number of menu items in a hierarchy, each of which is a link to somewhere in the site (or on another site). That's great, unless you want to have a menu tree that has items in it which are not, in fact, links. Several scenarios for this exist, including parent categories and section separators.

This page explains how to add "menu links" that will not actually link anywhere.

Modules

Modules that allow links that are not links:

Theme layer: Drupal 5

Alternatively, this can be accomplished in your theme:

Step 1

We will define the magic value <none> to mean "a path to nowhere", just like <front> means "the home page". The crucial part here is the theme_menu_item_link() function, which we will override. Place the following function in your template.php file.

<?php
function phptemplate_menu_item_link($item, $link_item) {
if ($item['path'] == '') {
$attributes['title'] = $link['description'];

Taxonomy menu: navigation for terms

Taxonomy terms allow classification of content into categories and subcategories. The Taxonomy Menu module adds links to the navigation menu for taxonomy terms. This is useful when the community is focused on creating content that is organized in a taxonomy.

Creating a Taxonomy Menu

In order to create a taxonomy menu, first create your vocabulary. If you have an existing vocabulary, navigate to the taxonomy administration menu. The path depends on your Drupal version (5, 6, or 7).

Subscribe with RSS Subscribe to RSS - menus