You are here

README.txt in Accordion Menu 6

Same filename and directory in other branches
  1. 7 README.txt
CONTENTS OF THIS FILE
---------------------

 * Author
 * Description
 * Installation
 * Dependencies
 * Configuration
 * Styling

AUTHOR
------
Jim Berry ("solotandem", http://drupal.org/user/240748)

DESCRIPTION
-----------
This module will display a Drupal menu using a jQuery UI accordion effect. The
top-level menu items are referred to as header items. The accordion effect is
invoked when the triggering event occurs on a header item. The triggering event
may be a mouse down, mouse click, or mouse over. The submenu expands to display
the menu items beneath the header. A subsequent triggering event on the same
header item collapses the menu beneath it.

INSTALLATION
------------
To use this module, install it in a modules directory. See
http://drupal.org/node/895232 for further information.

DEPENDENCIES
------------
The 6.x releases include the jQuery UI module is a dependency.  See the README
file included with the jQuery UI project at http://drupal.org/project/jquery_ui
for instructions on installing jQuery UI.

CONFIGURATION
-------------
By default, the module will declare two menu blocks. To set a different number
of available menu blocks, visit the module configuration page at
admin/config/user-interface/accordion_menu.

Each menu block may be configured from the block administration page at
admin/structure/block. Settings are exposed for:
- menu source: the menu to display as an accordion
- script scope: the script location in the page source (see drupal_add_js())
- header link: whether the header HTML output is a link
- header: the HTML tag used on the header items
- animate: the animation effect used to expand the submenu
- event: the triggering event
- collapsible: allow an expanded menu to collapse (requires jQuery UI 1.7.3+)
- all of the other published jQuery UI accordion options

If a header item is output as a link, then there may be a conflict between the
event triggering a redirect to the menu link and that enabling the accordion
effect. To avoid a clash of the JS behind the accordion effect and a mouse click
on a header menu link, it is recommended to leave the default setting which
outputs the header as a non-link item.

The collapsible setting has no effect with the jQuery UI versions that are
compatible with the jQuery 1.3 shipped with Drupal 6. In other words, with older
versions of jQuery UI Accordion, a subsequent triggering event will not collapse
a submenu. This problem seems to have been resolved in jQuery 1.3.2 and
jQuery UI 1.7.3. See the README file included with the jQuery UI project at
http://drupal.org/project/jquery_ui for instructions on installing these later
versions of jQuery.

STYLING
-------
Classes

Several classes are added to the HTML elements surrounding the menu, headers,
and submenu content.

wrapper
  The <div> wrapped around the menu tree has classes for several of the
  configurable options of the block: accordion-menu-[block delta]
  accordion-menu-name-[menu name] accordion-menu-source-[menu source]

header
  The header elements (default tag is <h3>) of the menu tree have classes:
  accordion-header-[item number] first last has-children no-children active
  active-trail odd even menu-mlid-[menu link ID]

header "link"
  The <span> or <a> element of a header item has classes: accordion-link
  active-trail

submenu item
  The <li> item has the standard classes added by the menu system.

submenu link
  The <a> item has whatever classes are added to the menu item, including those
  available from the Menu Atributes module.

The number and type of style sheet attributes needed to produce a desired visual
effect will depend on the jQuery UI version as that script has changed how it
modifies the HTML and the CSS classes it uses.

Templates

By default, the wrapper <div> for the block is generated using the
accordion-menu-wrapper.tpl.php template. This may be overridden by creating a
template file based on the theme hook suggestions for that template:
- accordion-menu-wrapper--[block delta].tpl.php
- accordion-menu-wrapper--[menu name].tpl.php

For example, a file called accordion-menu-wrapper--menu-foo.tpl.php can be used
to override the <div> for the custom menu "menu-foo" blocks. Add this file to
your theme.

Theme functions

Accordion Menu uses Drupal core's menu theme functions for the submenu items.
However, it provides theme hook suggestions for the header that can be used to
override this theme function:
- [theme]_accordion_menu_header__[block delta]()
- [theme]_accordion_menu_header__[menu name]()

For example, if you created a bartik_accordion_menu_header__1() function, it
would override theme_accordion_menu_header() to display the menu block with
delta of 1.

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Author
  4. * Description
  5. * Installation
  6. * Dependencies
  7. * Configuration
  8. * Styling
  9. AUTHOR
  10. ------
  11. Jim Berry ("solotandem", http://drupal.org/user/240748)
  12. DESCRIPTION
  13. -----------
  14. This module will display a Drupal menu using a jQuery UI accordion effect. The
  15. top-level menu items are referred to as header items. The accordion effect is
  16. invoked when the triggering event occurs on a header item. The triggering event
  17. may be a mouse down, mouse click, or mouse over. The submenu expands to display
  18. the menu items beneath the header. A subsequent triggering event on the same
  19. header item collapses the menu beneath it.
  20. INSTALLATION
  21. ------------
  22. To use this module, install it in a modules directory. See
  23. http://drupal.org/node/895232 for further information.
  24. DEPENDENCIES
  25. ------------
  26. The 6.x releases include the jQuery UI module is a dependency. See the README
  27. file included with the jQuery UI project at http://drupal.org/project/jquery_ui
  28. for instructions on installing jQuery UI.
  29. CONFIGURATION
  30. -------------
  31. By default, the module will declare two menu blocks. To set a different number
  32. of available menu blocks, visit the module configuration page at
  33. admin/config/user-interface/accordion_menu.
  34. Each menu block may be configured from the block administration page at
  35. admin/structure/block. Settings are exposed for:
  36. - menu source: the menu to display as an accordion
  37. - script scope: the script location in the page source (see drupal_add_js())
  38. - header link: whether the header HTML output is a link
  39. - header: the HTML tag used on the header items
  40. - animate: the animation effect used to expand the submenu
  41. - event: the triggering event
  42. - collapsible: allow an expanded menu to collapse (requires jQuery UI 1.7.3+)
  43. - all of the other published jQuery UI accordion options
  44. If a header item is output as a link, then there may be a conflict between the
  45. event triggering a redirect to the menu link and that enabling the accordion
  46. effect. To avoid a clash of the JS behind the accordion effect and a mouse click
  47. on a header menu link, it is recommended to leave the default setting which
  48. outputs the header as a non-link item.
  49. The collapsible setting has no effect with the jQuery UI versions that are
  50. compatible with the jQuery 1.3 shipped with Drupal 6. In other words, with older
  51. versions of jQuery UI Accordion, a subsequent triggering event will not collapse
  52. a submenu. This problem seems to have been resolved in jQuery 1.3.2 and
  53. jQuery UI 1.7.3. See the README file included with the jQuery UI project at
  54. http://drupal.org/project/jquery_ui for instructions on installing these later
  55. versions of jQuery.
  56. STYLING
  57. -------
  58. Classes
  59. Several classes are added to the HTML elements surrounding the menu, headers,
  60. and submenu content.
  61. wrapper
  62. The
    wrapped around the menu tree has classes for several of the
  63. configurable options of the block: accordion-menu-[block delta]
  64. accordion-menu-name-[menu name] accordion-menu-source-[menu source]
  65. header
  66. The header elements (default tag is

    ) of the menu tree have classes:

  67. accordion-header-[item number] first last has-children no-children active
  68. active-trail odd even menu-mlid-[menu link ID]
  69. header "link"
  70. The or element of a header item has classes: accordion-link
  71. active-trail
  72. submenu item
  73. The
  74. item has the standard classes added by the menu system.
  75. submenu link
  76. The item has whatever classes are added to the menu item, including those
  77. available from the Menu Atributes module.
  78. The number and type of style sheet attributes needed to produce a desired visual
  79. effect will depend on the jQuery UI version as that script has changed how it
  80. modifies the HTML and the CSS classes it uses.
  81. Templates
  82. By default, the wrapper
    for the block is generated using the
  83. accordion-menu-wrapper.tpl.php template. This may be overridden by creating a
  84. template file based on the theme hook suggestions for that template:
  85. - accordion-menu-wrapper--[block delta].tpl.php
  86. - accordion-menu-wrapper--[menu name].tpl.php
  87. For example, a file called accordion-menu-wrapper--menu-foo.tpl.php can be used
  88. to override the
    for the custom menu "menu-foo" blocks. Add this file to
  89. your theme.
  90. Theme functions
  91. Accordion Menu uses Drupal core's menu theme functions for the submenu items.
  92. However, it provides theme hook suggestions for the header that can be used to
  93. override this theme function:
  94. - [theme]_accordion_menu_header__[block delta]()
  95. - [theme]_accordion_menu_header__[menu name]()
  96. For example, if you created a bartik_accordion_menu_header__1() function, it
  97. would override theme_accordion_menu_header() to display the menu block with
  98. delta of 1.