I liked the way Taxonomy DHTML popped the description up in a tool-tip when you hovered over a term, so I patched the code below to provide that functionality.

/**
 * Implementation of hook_menu().
 *
 * Most of the heavy lifting of the module is done here.
 */
function taxonomy_menu_menu($may_cache) {
  $items = array();

  if ($may_cache) {
   $items[]= array (
      'path' => 'admin/settings/taxonomy_menu',
      'title' => t('Taxonomy Menu settings'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array('taxonomy_menu_admin_settings'),
      'access' => user_access('administer site configuration'),
      'description' => t('Global configuration of taxonomy menu functionality.'),
      'type' => MENU_NORMAL_ITEM,
    );

    $access = user_access('access content');

    foreach (taxonomy_get_vocabularies() as $vocabulary) {
      if (variable_get('taxonomy_menu_show_'. $vocabulary->vid, 1)) {
        $path = 'taxonomy_menu/'. $vocabulary->vid;
        $items[] = array('path' => $path, 'title' => t($vocabulary->name),
          'callback' => 'taxonomy_menu_page', 'access' => $access,
          'weight' => $vocabulary->weight, 'description' => t($vocabulary->description));

        $tree = taxonomy_get_tree($vocabulary->vid);
        $old_depth = -1;
        $old_path = $path;

        foreach ($tree as $term) {
          if ($term->depth <= $old_depth) {
            $slashes_to_remove = $old_depth - $term->depth + 1;
            for ($i = 0; $i < $slashes_to_remove; $i++) {
              $old_path = substr($old_path, 0, strrpos($old_path, '/'));
            }
          }
          $path = $old_path .'/'. $term->tid;
          $old_depth = $term->depth;
          $old_path = $path;
          $items[] = array('path' => $path, 'title' => t($term->name),
            'weight' => $term->weight, 'description' => t($term->description));
        }
      }
    }
  }

  return $items;
}

Comments

arlinsandbulte’s picture

Version: 5.x-1.x-dev » master
Assigned: sm0k3ymcl3ud » Unassigned
Status: Needs review » Needs work

+1
I agree this would be a nice feature in some cases, but I think there should be a toggle option.
Also, pushing this to head.... (3.0). New features are not being added to old versions (mostly) ;)

indytechcook’s picture

Status: Needs work » Closed (works as designed)

Taxonomy Menu does not do any of the display of the menu. It only creates the menu link items. This is not possible nor will it be in scope. The rendering of the menu (block or otherwise) will always be handled by other modules (mainly core).

There are several modules that manipulate the appearance of a menu/block. See DHTML_MENU http://drupal.org/project/dhtml_menu

Version 3 will allow for custom css classes do you can add the effects yourself in your theme.