You are here

README.txt in Accordion Menu 7

Same filename and directory in other branches
  1. 6 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
------------
Due to a core bug fixed in Drupal 7.12, the Menu Block module is a dependency
for this module prior to the 7.x-1.1 release.

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
- 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.

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. Due to a core bug fixed in Drupal 7.12, the Menu Block module is a dependency
  27. for this module prior to the 7.x-1.1 release.
  28. CONFIGURATION
  29. -------------
  30. By default, the module will declare two menu blocks. To set a different number
  31. of available menu blocks, visit the module configuration page at
  32. admin/config/user-interface/accordion_menu.
  33. Each menu block may be configured from the block administration page at
  34. admin/structure/block. Settings are exposed for:
  35. - menu source: the menu to display as an accordion
  36. - script scope: the script location in the page source (see drupal_add_js())
  37. - header link: whether the header HTML output is a link
  38. - header: the HTML tag used on the header items
  39. - animate: the animation effect used to expand the submenu
  40. - event: the triggering event
  41. - collapsible: allow an expanded menu to collapse
  42. - all of the other published jQuery UI accordion options
  43. If a header item is output as a link, then there may be a conflict between the
  44. event triggering a redirect to the menu link and that enabling the accordion
  45. effect. To avoid a clash of the JS behind the accordion effect and a mouse click
  46. on a header menu link, it is recommended to leave the default setting which
  47. outputs the header as a non-link item.
  48. STYLING
  49. -------
  50. Classes
  51. Several classes are added to the HTML elements surrounding the menu, headers,
  52. and submenu content.
  53. wrapper
  54. The
    wrapped around the menu tree has classes for several of the
  55. configurable options of the block: accordion-menu-[block delta]
  56. accordion-menu-name-[menu name] accordion-menu-source-[menu source]
  57. header
  58. The header elements (default tag is

    ) of the menu tree have classes:

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