DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:acmenu

This is an old revision of the document!


AcMenu Plugin

Compatible with DokuWiki

2017-02-19 "Frusterick Manners"

plugin An accordion menu for namespaces and relative pages.

Last updated on
2017-04-27
Provides
Syntax
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with menu, navigation

Description

AcMenu provides an accordion menu which lists contents of namespaces in a tree-like format. The tree is built starting from the namespace where the AcMenu's syntax lives till the very end namespace.

This plugin respects the ACL rules and the sneaky_index, hidepages options that come with your DokuWiki configuration.

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Syntax

In the sidebar page, use the syntax:

<acmenu>

Examples

Just some screenshots to give you an overall idea of the final result.

Suppose you want to split your main wiki in two sub-wiki independent between them, as follows:

+--sidebar.txt
+--start.txt
+--branch-a
|  +--sidebar.txt
|  +--start.txt
|  +--products
|  |  +--start.txt
|  +--services
|  |  +--start.txt
|  +--private
|     +--start.txt
|     +--confidential.txt
+--branch-b
   +--sidebar.txt
   +--start.txt
   +--products
   |  +--start.txt
   +--services
   |  +--start.txt
   +--private
      +--start.txt
      +--confidential.txt

Than you can populate each sidebar.txt in the following manner:

  • in :sidebar.txt
    <acmenu>
  • in :branch-a:sidebar.txt
    [[..:start| Back to Main]]
    <acmenu>
  • in :branch-b:sidebar.txt
    [[..:start| Back to Main]]
    <acmenu>

When a visitor is in :start.txt, the plugin shows the complete tree namespace collapsed except the namespace in which the sidebar.txt with AcMenu's syntax it is. Only if the visitor's browser has JavaScript disabled all namespaces reveal their content so that it's possible to continue the navigation.

If the visitor decides to open a :branch-* or any its sub-namespaces :branch-*:*, the AcMenu shows only the sidebar relative to the current branch.

If the visitor is a guest and he doesn't have the permission to enter in any :branch-*:private area, you should set the appropriate rule in the ACL management. Furthermore you can hide to him the :branch-*:private namespace setting up the sneaky_index option in your Configuration Manager.

If the visitor is a user registered and has the permission to enter in any :branch-*:private area but not to see the :branch-*:confidential.txt page, you should set the appropriate rule in the ACL management.

Furthermore it's possible to hide all sidebar.txt page using the hidepages option in your Configuration Manager:

^:(?:.*sidebar)

Since this plugin uses cookies to remember the page visited (they are automatically deleted as soon as the window browser is closed) if the visitor come back to :start.txt the branch and its sub-namespaces opened will stay open.

The order in which the tree directory is presented is the following:

  • first, folders from 0-9A-Za-z
  • then, files from 0-9A-Za-z

This means that, if the option useheading is enabled, it's possible to force the order of files using a progressive numeration in the first heading of each file.

Configuration and Settings

The navigation through namespaces and the links to the relative pages work as follows:

  • on namespace:
    • one click: shows/hides the relative content;
    • double click: opens the relative start page;
  • on page:
    • one click: opens the relative page.

Hide namespaces and pages

First, set the appropriate permissions in your ACL management. Then, use the options:

Troubleshooting

Symptom: AcMenu doesn't show/hide namespace's content.

Possible solution: be sure that javascript is enabled in your browser, otherwise all namespaces remain open showing their content.


Development

Known Bugs and Issues

Please, use the relative bug tracker or write here and then I will move there.
Torpedo 2017-03-09 16:32

ToDo/Wish List

Let me know what do you think about this plugin and how can I improve its functionality.
Torpedo 2017-03-09 16:33

Is there a way to make the menu elapsed on default?
Do you mean elapsed = uncollapsed?
If so, the answer (at the moment) is no. The reason is, if one has many namespaces each one with as many sub-namepsces, the result is an ugly menu maybe longer than the page and, maybe, larger than the width of the sidebar, due of the indentation.
At the beginning I would add an option which should have inserted a button “show/hide all” but then I realized that, with very long menu, the result was awful, especially with small monitor or with short page so that one will never use the button “show all”. This is way I've opted to keep the items uncollapsed gradually one visits them and give him freedom of choice to collapse what he wants.
For me, this is a good compromise but I don't rule out better ideas.
Torpedo 2017-04-13 19:33
I've made a new release which, for default, only at the first visit, keeps open only the namespace where the syntax lives.
Torpedo 2017-04-23 09:15
plugin/acmenu.1493536250.txt.gz · Last modified: 2017-04-30 09:10 by torpedo

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki