You are here

README.txt in Better Jump Menus 7

Same filename and directory in other branches
  1. 8 README.txt
  2. 6 README.txt
Install...
Normal procedure:
1) Place in modules/contrib/jump_menu
2) Enable at admin/build/modules or via drush.
3) Visit the block editing page (or use context/panels/etc) to place one of
   the newly avialble jump menu blocks on the page.
4) Developers: create a custom module which populates a jump menu however
   you like and exposes a block or page callback element.

Menus...
This modules runs from: any exsisting menu, from any parent item, to any depth.
Create the menu you want manually, via nodes, Taxonomy Menu, Auto Menu, etc.
A great place to easily find the menu ID number is the edit link within the
admin/build/menu area.

Placing...
This module will create a jump down block for each menu on your site.
These blocks are created to allow non-developers to make use of this module.
A block will also be available for local menu tasks (like node view/edit/revisions/etc).

Additionally this module can be used by developers to place drop-down menus via
the nice clean output function. Though it's sacrilege, you can just place this
code in a block with PHP Input Format. However what you should do is create a
small module to provide the blocks you need.

Configuration...
Set your "please choose" text (which displays as the first item in the menu)
by setting a custom block title. By default the block title will remain as the
menu name and the menu name will appear as the text within the drop down.
If you set the block title it will remove normal block title display.

Code...
jump_menu($menu, $parent, $btn = false, $maxDepth = 0, $choose = 'Select Now', current = FALSE);

A hard coded specific menu would look something like this:

Drupal 7:
<?php
function MYMODULE_block_info() {
  $menu_name = 'YOUR-MENU-MACHINE-NAME-HERE';
  $blocks = array(
    'MYMODULE' => array(
    'info' => t('My Jump Menu'),
    'cache' => DRUPAL_NO_CACHE,
    ),
  );
  return $blocks;
}

function MYMODULE_block_view($delta = '') {
  if (module_exists('jump_menu')) {
    $data = array(
      'subject' => t('My Jump Menu Title'),
      'content' => jump_menu($menu_name, 0, FALSE, 0, t('-- Select destination --')),
    );
    return $data;
  }
}
?>

Drupal 6:
<?php
function MYMODULE_block($op = 'list', $delta = 0) {
  $menu_name = 'YOUR MENU MACHINE NAME HERE';
  if (module_exists('jump_menu')) {
    switch ($op) {
      case 'list':
        $blocks = array();
        $blocks['mymodule_' . $menu_name]['info'] = t('My Jump Menu');
        $blocks['mymodule_' . $menu_name]['cache'] = BLOCK_NO_CACHE;
        return $blocks;
        break;

      case 'view':
        $data['subject'] = t('My Jump Menu Title');
        $data['content'] = jump_menu($menu_name, 0, FALSE, 0, '-- Select destination --');
        return $data;
        break;
 
    }
  }
}
?>

Recommendations...
This module has been useful for folks looking for alternate mobile menus.
Try hiding this menu for desktop users and exposing it for mobile devices.

Admin drop downs are pretty useful, either based on the Navigation menu or
better yet one created specificly for your various editor roles.

<?php
if (module_exists('jump_menu')) {
  echo jump_menu('navigation', 18, 'Go!', 0, 'Manage the Site');
}

File

README.txt
View source
  1. Install...
  2. Normal procedure:
  3. 1) Place in modules/contrib/jump_menu
  4. 2) Enable at admin/build/modules or via drush.
  5. 3) Visit the block editing page (or use context/panels/etc) to place one of
  6. the newly avialble jump menu blocks on the page.
  7. 4) Developers: create a custom module which populates a jump menu however
  8. you like and exposes a block or page callback element.
  9. Menus...
  10. This modules runs from: any exsisting menu, from any parent item, to any depth.
  11. Create the menu you want manually, via nodes, Taxonomy Menu, Auto Menu, etc.
  12. A great place to easily find the menu ID number is the edit link within the
  13. admin/build/menu area.
  14. Placing...
  15. This module will create a jump down block for each menu on your site.
  16. These blocks are created to allow non-developers to make use of this module.
  17. A block will also be available for local menu tasks (like node view/edit/revisions/etc).
  18. Additionally this module can be used by developers to place drop-down menus via
  19. the nice clean output function. Though it's sacrilege, you can just place this
  20. code in a block with PHP Input Format. However what you should do is create a
  21. small module to provide the blocks you need.
  22. Configuration...
  23. Set your "please choose" text (which displays as the first item in the menu)
  24. by setting a custom block title. By default the block title will remain as the
  25. menu name and the menu name will appear as the text within the drop down.
  26. If you set the block title it will remove normal block title display.
  27. Code...
  28. jump_menu($menu, $parent, $btn = false, $maxDepth = 0, $choose = 'Select Now', current = FALSE);
  29. A hard coded specific menu would look something like this:
  30. Drupal 7:
  31. function MYMODULE_block_info() {
  32. $menu_name = 'YOUR-MENU-MACHINE-NAME-HERE';
  33. $blocks = array(
  34. 'MYMODULE' => array(
  35. 'info' => t('My Jump Menu'),
  36. 'cache' => DRUPAL_NO_CACHE,
  37. ),
  38. );
  39. return $blocks;
  40. }
  41. function MYMODULE_block_view($delta = '') {
  42. if (module_exists('jump_menu')) {
  43. $data = array(
  44. 'subject' => t('My Jump Menu Title'),
  45. 'content' => jump_menu($menu_name, 0, FALSE, 0, t('-- Select destination --')),
  46. );
  47. return $data;
  48. }
  49. }
  50. ?>
  51. Drupal 6:
  52. function MYMODULE_block($op = 'list', $delta = 0) {
  53. $menu_name = 'YOUR MENU MACHINE NAME HERE';
  54. if (module_exists('jump_menu')) {
  55. switch ($op) {
  56. case 'list':
  57. $blocks = array();
  58. $blocks['mymodule_' . $menu_name]['info'] = t('My Jump Menu');
  59. $blocks['mymodule_' . $menu_name]['cache'] = BLOCK_NO_CACHE;
  60. return $blocks;
  61. break;
  62. case 'view':
  63. $data['subject'] = t('My Jump Menu Title');
  64. $data['content'] = jump_menu($menu_name, 0, FALSE, 0, '-- Select destination --');
  65. return $data;
  66. break;
  67. }
  68. }
  69. }
  70. ?>
  71. Recommendations...
  72. This module has been useful for folks looking for alternate mobile menus.
  73. Try hiding this menu for desktop users and exposing it for mobile devices.
  74. Admin drop downs are pretty useful, either based on the Navigation menu or
  75. better yet one created specificly for your various editor roles.
  76. if (module_exists('jump_menu')) {
  77. echo jump_menu('navigation', 18, 'Go!', 0, 'Manage the Site');
  78. }