Jump
The jump module allows administrators to create a quick dropdown "Jump Menu" from any configured menu or vocabulary in the system. The module provides a block for every top-level menu and every vocabulary. Jump menu blocks are named Jump menu: vocabulary name and Jump menu: menu name.
In addition, administrators may continue to use the jump_quickly() API that was used in the Drupal 5.x version, with the exception being that menus are now referenced by name as opposed to id.
To programmatically make a jump menu appear in a block whose input format is set to "PHP code" use one of:
-
<?php
print jump_quickly(5, 'taxo');
?>
Where 5 is the vocabulary with vid 5. -
<?php
print jump_quickly('primary-links');
?>
Where 'primary-links' could be the name of any menu in the system. -
<?php
global $user;
$options = array(
'user/'. $user->uid => t('My User Account'),
'tracker/'. $user->uid => t('My Posts'),
'logout' => t('Log Out')
);
print jump_quickly($options);
?>
Where the keys to the $options array are menu paths and the values in the array are labels that appear in the drop-down.
Note 1: At this time there is no automatic upgrade code to convert 5.x API calls using id-based menus to the 6.x name-based menus.
Note 2: If you were using the 5.x version of Jump menu, you'll need to manually enable the new Jump blocks. Aside from that hassle, things should work the same.
Note 3: The 5.x version of Jump does not provide out-of-the-box menus for vocabularies and menus. For the 5.x project description, see below.
Drupal 5.x description
The jump module allows administrators to create a quick dropdown "Jump Menu" from any configured menu or vocabulary in the system.
Administrators may also easily create jump menus by sending in an options array containing path/title associations.
Suggested use:
- Create a block with the input format set to "PHP code"
- Put the following into the block body:
<?php
print jump_quickly(1);
?>This will give you a block with a dropdown for each menu item that belongs to the menu with id 1 (usually this is the Navigation
menu). Change the 1 to any menu id in order to have that menu's items appear in the dropdown. - If you don't know what menu id you are looking for, put this in your block:
<?php
print jump_menu_item_list(0);
?>This will print out the top level menu names along with their ids. When you find the one you want, go back to step 2 and put
in the correct id.
Another suggested use:
- Create a block with the input format set to "PHP code"
- Put the following into the block body:
<?php
print jump_quickly(5, 'taxo');
?>This will give you a dropdown containing all the terms in the vocabulary with vid 5.
Yet another suggested use:
- Create a block with the input format set to "PHP code"
- Put the following into the block body:
<?php
global $user;
$options = array(
'user/'. $user->uid => t('My User Account'),
'tracker/'. $user->uid => t('My Posts'),
'logout' => t('Log Out')
);
print jump_quickly($options);
?>This will give you a dropdown with three items in it -- My User Account, My Posts, and Log Out. This gives you the most flexibility, but requires a bit more actual PHP in your snippet.
Jump was developed by the friendly primates at FunnyMonkey.
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.0 | 2008-Jul-11 | 7.89 KB | Download · Release notes | Recommended for 6.x | |
| 5.x-1.1 | 2008-Aug-02 | 7.94 KB | Download · Release notes | Recommended for 5.x | |
| Development snapshots | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.x-dev | 2008-Jul-12 | 7.9 KB | Download · Release notes | Development snapshot | |
