Table of Contents

« indexmenu

Read before post

:!: Before opening a discussion, check if it's already covered in this page (the TOC on the right side is a good and quick way to find them) or in the faq and notes section.
If you think that you have discovered a bug, report it, with details, in the bugs section.
This page is only for feature requests or general indexmenu discussion.

You can find old discussions in the olddiscussion page.

Theme downloads

Is there a URL for downloading themes? I can see different ones exist here http://samuele.netsons.org/dokuwiki/doku.php?id=playground:playground and the doc says “Inside the Admin panel there is the option to download js themes from my site”, but the server I'm running DokuWiki on doesn't have internet access. I've looked all around this site but can't find the downloads! Thanks.
RNM 2009-06-19

You can find cached versions in the theme repository. Be aware that some theme could not be present or updated until someone requests them with the DokuWiki “Indexmenu Utility”. — Samuele Tognini 2009/07/06 13:39

Tip: fold-down indexmenu

Indexmenu works a treat with the folded plugin. Indexmenu is initially concealed, but on clicking the title, the menu will fold down.

Use syntax such as:

 ++++site navigation|{{indexmenu>home#1|js navbar nocookie}}++++

To have the indexmenu (and other folded content) fold out over the page (rather than into the document flow) change the following style rule in the style.css for the folded plugin to:

div.folded {
    position: absolute;
    background-color: __white__;
    padding: 0.5em;
    border: 1px dotted __medium__;
}

Green Box 2007-02-24 05:24

Incompatibility with npd plugin

This plugin doesn't work well with the npd plugin to create new pages as the npd plugin attaches events to the standard index tree of DokuWiki instead of the indexmenu tree. Would it be possible to disable indexmenu in the 'new page' window the npd plugin creates, in order to have the standard index tree working in only that window? 2009/16/04

What are the steps to reproduce the npd bug? For what I see with my quick test, ndp opens a new windows with his own working index that does not affects the indexmenu one. — Samuele Tognini 2009/04/19 02:39

In my wiki I see the indexmenu index in the npd window not the standard index. As soon as I remove the indexmenu plugin the npd window starts working fine. It seems the init_index JavaScript function of npd doesn't understand the indexmenu syntax.

Did you enabled the replace_index indexmenu option? The following patch should fix it:
diff -rN -u old-indexmenu/action.php new-indexmenu/action.php
--- old-indexmenu/action.php    2009-05-08 11:02:48.000000000 +0200
+++ new-indexmenu/action.php    2009-05-08 11:02:49.000000000 +0200
@@ -128,6 +128,7 @@
    */
   function _loadindex(&$event, $param) {
     if ('index' != $event->data) return;
+    if ($_REQUEST['npd']) return;
     if (!file_exists(wikiFN($this->getConf('page_index')))) return;
     global $lang;
     print '<h1><a id="index" name="index">'.$lang['btn_index']."</a></h1>\n";

Context menu not showing

I have two installs of DokuWiki, one at home and one at work. Using the same theme (sidebar theme). My work install doesn't have the right-click context menu. I have looked through all the discussions, checked and compared settings of both installs, but for the life of me I just can't get context menu to show. I'm using the following configuration

{{indexmenu>..#1|js navbar nocookie id#random tsort}}

Help! — tyh 2009/12/02 16:30

Check for JavaScript errors in the Firefox error console after disabling the DokuWiki compress option. This helps to debug and to find what plugin (indexmenu itself or others) leads to errors that could prevent indexmenu to work correctly.

Have disabled compression of CSS and JavaScript from the config. When trying to right click on indexmenu tree I get the js error Use of getBoxObjectFor() is deprecated. Try to use element.getBoundingClientRect() if possible. Also there are also quite a few errors in css.php. Could it be my DokuWiki install or Firefox?

tyh 2009.12.03 1040

I tried using Google chrome browser to load DokuWiki page and right-click context menu works there! Think it's a problem with Firefox, but I'm using Firefox both at work and at home. Have tried clearing Firefox's cache, purging DokuWiki, but still can't get context menu to work.

tyh 2009.12.03 1104

To correctly debug errors:

Following the above steps, I get the following messages:

There's no errors with any .js files. The problem is with my Firefox. Checked with my colleague and indexmenu works fine in his Firefox. :(

tyh 2009.12.04 1501

I can only suggest you to disable all the Firefox add-ons. If it works, try to enable them one by one in order to find the buggy one.

Have found the DokuWiki add-on causing this problem - All-in-one Gestures. After disabling this add-on, right-clicking shows the context menu for indexmenu :)

tyh 2009.12.14 1216

Left/Up/Right navigation for books

Hey folks - thanks for this terrific plugin. I am involved in a project to produce a book using DokuWiki - and we are 80% there. Right now we have manually inserted left/right arrows at the bottoms of pages to move to the previous or next page in the book. This is silly since the arrows become part of the document which we don't want for printing etc. My thought is that indexmenu, which we are using in the left-hand navigation in the monobook template, seems the tool for the job for this. Would it be possible? I'm thinking something simple and intuitive that shows the titles of the previous and next page in the book - like on a WordPress blog like this example. — Tobias Eigen 2007-03-21 15:19

I think that indexmenu is not good for this, because it's main purpose is to show trees and not navigation arrows. Probably the best solution is to write a new plugin. Anyway, I see that in DokuWiki forum you could have found a solution.
One advantageous thing that indexmenu provides is an ordering of pages in a namespace (be it via titles, msort, etc…) which is then used to build the tree. Since the same information (previous, next, up, childs) has validity for a “book navigation” system I think it could be plausible to make indexmenu provide a list of pages, via JavaScript or a PHP variable, as if it was a helper plugin. From there, it would be possible for anyone very interested to create a plugin that requests the information from indexmenu. – — Luis Machuca Bezzaza 2009/10/09 18:29
Yes, it's a long time that I'm thinking to implement an helper plugin (for example to easily solve the navigation feature request). I'm still too busy for a short-time implementation, but this is in my priorities. — Samuele Tognini 2009/10/10 19:26

Headpage sort above in index

Every of my namespaces has a headpage (original called:start). This pages is between all the other pages. I like it shows up there, but I wish it is always the first of the pages. – Klap-in

The next changeset adds an option hsort. When this option is used each headpage gets the sort value equivalent to {{indexmenu_n>1}}. So the headpage is always the first item of the index. Using msort overrules this again. –Klap-in
modification.txt
Index: trunk/wiki/lib/plugins/indexmenu/syntax/indexmenu.php
===================================================================
--- a/trunk/wiki/lib/plugins/indexmenu/syntax/indexmenu.php
+++ b/trunk/wiki/lib/plugins/indexmenu/syntax/indexmenu.php
@@ -125,4 +125,6 @@
     //Directory sort
     $nsort=in_array('nsort',$opts);
+    //sort headpages up
+    $hsort=in_array('hsort',$opts);
     //Metadata sort method
     if ($msort = in_array('msort',$opts)) {
@@ -153,4 +155,5 @@
     if ($msort) $jsajax .= "&msort=".$msort;
     if ($rsort) $jsajax .= "&rsort=1";
+    if ($hsort) $jsajax .= "&hsort=1";
     if ($nsort) $jsajax .= "&nsort=1";
     if ($nopg) $jsajax .= "&nopg=1";
@@ -175,5 +178,6 @@
                        'headpage' => $this->getConf('headpage'),
                        'hide_headpage' => $this->getConf('hide_headpage')
-                       )
+                       ),
+                $hsort
                  );
   }  
@@ -247,10 +251,11 @@
     $this->rsort = $myns[4];
     $this->nsort = $myns[5];
-    $opts = $myns[6];
+    $opts = $myns[6]; 
+    $this->hsort = $myns[7];
     $output=false;
     $data = array();
     $js_name="indexmenu_";
     $fsdir="/".utf8_encodeFN(str_replace(':','/',$ns));
-    if ($this->sort || $this->msort || $this->rsort) {
+    if ($this->sort || $this->msort || $this->rsort || $this->hsort) {
       $custsrch=$this->_search($data,$conf['datadir'],array($this,'_search_index'),$opts,$fsdir);
     } else {
@@ -696,4 +701,5 @@
    */
   function _setorder($item) {
+    global $conf;
     $sort=false;
     if ($item['type']=='d') {
@@ -704,4 +710,5 @@
     if ($page) {
+      if ($this->hsort && noNS($item['id'])==$conf['start']) $sort=1;
       if ($this->msort) $sort=p_get_metadata($page,$this->msort);
       if (!$sort && $this->sort) {
         switch ($this->sort) {

Edit Mode Behavior

We use indexmenu in our template, and it works great. See http://www.minifienixon.com/doku.php (in the dropdown on the right) for example. In our template, indexmenu persists in page edit mode. This request is to change the behavior of indexmenu in edit mode. Instead of navigating to the selected page (which makes no sense while editing) could clicking a pagename instead insert the selected page name as a standard DokuWiki link at the carat in the edit box?

Green Box 2007-08-27 12:23

This is a good idea, but I'd rather prefer don't change the left click behavior. What about a right context menu with actions like edit/delete a page and insert the DokuWiki link when in edit mode? — Samuele Tognini 2007-08-29 22:09
Yep, right click menu would be fine. Insert DokuWiki link, edit, move or delete(if authorised), ACL?. Insert DokuWiki link would be the most useful. — Green Box 2007-08-30 03:44
Ok, I'll work on it and I'll email you when a testing release will be ready :-)Samuele Tognini 2007-08-30 21:33
I've implemented a basic and customizable context (right) menu in the development release, you can try it also at my site. Soon I'll add an option in the menu to insert DokuWiki link in edit mode and, if not too much “expensive” in coding terms, to change the default link node action as you asked. — Samuele Tognini 2007-09-15 12:42
Nice, Samuele. Let me know if you need some testing help. — Green Box 2007-09-15 13:36
Yes, any testing and feedback, also via email, is always well accepted. About this feature, I'd be glad if you could test it on different DokuWiki themes and browsers (Ie7 and Firefox seems to work). Better use darcs (as explained in development section) to get an update indexmenu repository, but if you email me I'll send you a zip from last snapshot. Ah, the insert DokuWiki link option in the context menu is ready. — Samuele Tognini 2007-09-23 12:27
I find this feature very good for wikis where the users aren't very technical! But I've found one problem, when I'm in editing mode and expand/collapse a level-1 namespace, I get the “Unsaved changes will be lost. Continue anyway?”-message, even though I'm not actually clicking a link to leave the page. In fact, it seems like the warning only appears for level-1 pages and namespaces. When I click a level-2 page I don't get any warning even though this time I actually leave edit-mode. —- Erik H 2008-04-15 21:33

Alphabetized under a certain letter

I would like to be able to make different index menus in a way that I choose what namespaces to skip. I can't do that since the config is only for all indexmenus in general.

my ultimate goal was to create a “menu” in which I can have everything alphabetized under a certain letter that will unhide a div containing and indexmenu without having to create a new namespace.

example:

A
 \apple
 \arch
B
 \bill
 \brat

Can someone suggest something I can do???

Take a look at the alphaindex plugin. It lacks the effects of a JavaScript tree, but it could be sufficient for your goal. If your pages were already sorted inside alphabetical namespaces, you'd able to reach your goal using the inline_folding2 plugin. Something like that:
A ++++
 {{indexmenu>A| nons}} ++++
++++ B |
{{indexmenu>B|nons}} ++++
...
Samuele Tognini 2007-10-05 21:42

hack JavaScript to skip the headpage in context menu for page creation

in context_menu.js, change “debut” and “DEBUT” with the name of your headpage, for example “start” by default.

This hack may be fixed by a more talented coder :!FIXME in the indexmenu plugin… just to no matter do the trick :

function indexmenu_reqpage(u,s,id) {
    var r=id||prompt("Insert the pagename to create","");
    if (r) {
 
 
u = u.replace(":debut", ""); 
u = u.replace(":DEBUT", ""); 
 
window.location.href=u+s+r+"&do=edit";
}
}

Mix namespaces and pages when sorting

I would find it very useful to have greater control over the sorting of namespaces and pages. What I would like to achieve:

Menu
-NS1
-Page2
-Page3
-NS4
-Page5

Of course it would be nice if it was possible to do this for all sorting options, but the most important, at least for me, is msort so that I can order pages myself.

Erik H 2008-04-16 00:35

Why mix, at the same tree level, pages and namespaces? It should be hard to implement and at the moment I don't see a valid reason for this. I think of indexmenu as a sort of filebrowser and filebrowsers don't mix directories and files when you sort them, aren't they? — Samuele Tognini 2008/04/25 01:00
I too would like to sort namespaces within pages. Which files from indexmenu would need to changed? I'll take a look… — Keith Edmunds 2010/09/23 20:43
At the moment we are using DokuWiki to document the functionality of our software. In this, we sometimes need the ability to create a 'subpage'. We achieved this by creating a namespace and a headpage for the particular namespace. This works well with Indexmeny as well, but we have the same problem, we would like the namespace to be mixed between the pages. Let me give an example:
Software User Manual
|
|- 1.0 Installation
|- 2.0 Configuration 
|  |-2.1 Global Configuration
|  |-2.2 User Configuration
|  |-2.3 Exporting/Importing Configurations
|-3.0 Uninstalling

Above is the logical order of how it should be, however indexmenu always moves 2.0 Configuration to the top as it is a namespace. So we too would really like to have this feature. Is there anyway we could be of use? Kulendra 'KJ' Janaka 2011/04/05 12:00

Possibility to specify pages to skip

It would be very practical if it was possible to specify pages and namespaces to exclude when adding an indexmenu to a page. Maybe like this:

{{indexmenu>.#1 | wiki | js navbar msort }}

Where the wiki namespace would be excluded. This is would allow for much more flexible use of indexmenu as navigation in sidebars. For example, it would be possible to use indexmenu both for as a lightweight navigational menu and as an index of all pages.

Maybe it's even possible to let us specify “mount-points” on different levels in the pagetree? That would be really awesome!

Erik H 2008-04-16 00:35

<navigation> tag from indexmenu2

Would it be possible to add the navigation feature of indexmenu2 to the indexmenu plugin?

The indexmenu2 plugin works fine, but I prefer some of the features in indexmenu. (I use the navigation feature to build indexes that are not related to namespaces.)

Tom T 2008-05-27 19:59

JavaScript translation

Is there any way to have language files for the js context menu? I am going to translate it to Spanish by hacking the /jsmenu files, but I would like to do in in a better way. Thanks

No, I'm sorry but there is no such translation mechanism. — Samuele Tognini 2008/09/22 22:24

Startup hook script

I utilize YUI dialogs in some of my context menus. This means that I need to include a few external CSS and JavaScript files to be invoked once. That is, I need to do this basically: (the functions loadCss and loadJavascript are my own functions that loads these resources into the head section of the HTML page)

loadCss('http://yui.yahooapis.com/2.7.0/build/fonts/fonts-min.css');
loadCss('http://yui.yahooapis.com/2.7.0/build/button/assets/skins/sam/button.css');
loadCss('http://yui.yahooapis.com/2.7.0/build/container/assets/skins/sam/container.css');
loadJavascript('http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js');
loadJavascript('http://yui.yahooapis.com/2.7.0/build/element/element-min.js');
loadJavascript('http://yui.yahooapis.com/2.7.0/build/button/button-min.js');
loadJavascript('http://yui.yahooapis.com/2.7.0/build/container/container-min.js');
loadJavascript('http://yui.yahooapis.com/2.7.0/build/yui-dialogs.js'); 

This works great if I patch the init-function of indexmenu.js and insert the code there. But if I attempt to do this in each of the three jsmenu files instead it works in some cases, in others it doesn't. I guess it depends on in which order things are loaded…

I would greatly appreciate if a user definable script file could be added to indexmenu to be loaded by indexmenu once at startup. This new file could contain custom functions such as the above. What do you think?

Cheers Urban

JavaScript menu files should be the right places for this as they are really loaded once at startup on every DokuWiki page. I strongly suggest you to use event_handling for your purpose.
In details, create a single function which contains your above code (i.e: yui_function() ), then load it with the init event handler:
addInitEvent(function(){yui_function();});
Just as a note, indexmenu already implements resources loading into the head section of a page. Check the “indexmenu_loadJs” function inside script.js and the “loadCss” prototype function inside indexmenu.js, which needs to refer to indexmenu objects but let you to differ CSSs depending on JavaScript themes.— Samuele Tognini 2009/07/10 10:01

Perfect! I'll tried that and it worked great. Many thanks. Urban

Problems with ACLs and subspaces

Hi, first, thanks for this great plugin. I have installed it in a environment with subspaces, permissions al LDAP authentication. Permissions work fine, but some namespaces the user does not have access are shown in the index menu. My conf. is this:

$conf['sneaky_index']   = 0;
$conf['plugin']['indexmenu']['aclcache'] = 'user';
$conf['plugin']['indexmenu']['headpage'] = ':start:';
$conf['plugin']['indexmenu']['page_index'] = 'sidebar';
$conf['plugin']['indexmenu']['skip_file'] = '/(sidebar)/';

$conf['useacl']         = 1;
$conf['authtype']       = 'ldap';

The ACL is this:

acerca_de                       @ALL                     1
*                               @ALL                     0
inicio                          @autentificados          1
playground:*                    @autentificados          2
clientes:client1:project1:*     @sacyl%5fec             16
clientes:client1:project2:*     @sacyl%5fldap           16
sidebar                         @ALL                     1
interno:sistemas:city1:*        @sistemas%5fcity1       16
wiki:*                          @autentificados          1

When a user that begins to sistemas_city1 logins, he also sees the clients namespace (but empty), although he has not permissions to access it, neither any if the subspaces. The same occurs with unauthenticated users, they also see clients and internal subspaces, but the shouldn't. Why does this happens? Can I fix it?

This is my sidebar.txt:

{{indexmenu>..#0 | js navbar tsort nsort noscroll nocookie id#random}}

Regards and thanks in advance.

Please, read the about_acls section for solutions. This behaviour does not depend on indexmenu but on DokuWiki itself. — Samuele Tognini 2009/07/16 14:59

Page Above namespace

I would like to have a menu like this

Home
|_ Folder 1
|_ Folder 2
| |_ Page 2.1
| |_ Folder 2.2
| |_ Folder 2.3

That is the page is above the folder. Right now the indexmenu pages go below the namespace

Sorry but you can't. Duplicate of the mix_namespaces_and_pages_when_sorting discussion. — Samuele Tognini 2009/07/16 14:59

Syntax Format for navigation

Is there a option for allow the user to specify the navigation in Syntax Format like

<navigation | js#IndexMenu>
  * NS1
    * NS 1.1
    * NS 1.2
  * NS2
</navigation>

This option exists in indexmenu2. Is there a way to do it in indexmenu

Sorry but at this moment it's not supported. When I'll have more free time and more motivations I'll try for a solution. Duplicate of the navigation_tag_from_indexmenu2 discussion. — Samuele Tognini 2009/07/16 14:59
I implemented this feature with minimal invasion of the original indexmenu. You can read and download it from: http://www.ceng.metu.edu.tr/~ahmet/Mektep/index.php?id=mektep:plugins&serveplugin_help=indexmenu. — Ahmet Sacan 2009/09/20

changing indexmenu font colour

having latest DokuWiki and latest stable indexmenu, I tried to change indexmenu font colour only. I mucked around with style.css, trying all colour options - especially changing the _ _existing_ _ one. in the end, I couldn't get it changed, green colour was always used. the only way to get this change was to change _ _existing_ _ for the whole theme, which is not desired. as a non-coder I have to ask - how can I change font colour for indexmenu entries only? thanks. — rich 2009/08/08 20:39

You need to add the !important declaration which prevents the parent overriding style. for example:
.dtree a {
  color: orange !important;
  text-decoration: none;
}
Samuele Tognini 2009/08/09 09:04
yay, it works - huge thanks :) — rich 2009/08/09 10:54

Exclusion

the complete situation is that I have a lot of namespaces, but want to exclude one, to show it below, more prominently. I cant find how to exclude one namespace in the syntax, I'll first explain:

instead of

start
- 1
- 2
- 3
  - 1
  - 2
  - 3
  - 4
- 4
- 5

I would like to do the following:

start 
- 1
- 2
- 4
- 5

3
- 1
- 2
- 3
- 4

I can find that it is possible to exclude a namespace, but I don't want it to be excluded completely is there a way to reach this?

I hope that someone can help me, grtz Theo

Try this: set the skip_index as follow:
/^3$/


Or if you have other namespaces to skip (for example “mynstoskip”):

/(mynstoskip|^3$)/


then use this indexmenu syntax, where ”…” are your preferred options:

{{indexmenu>#1|...}}
{{indexmenu>3#1|...}}


This should work. Take care that the skip_index affects all the indexmenu indexes of your site and the “3” ns will be displayed only when directly recalled as in the above second example. — Samuele Tognini 2009/09/04 15:54

Thank you!
In my case it worked, but I encounter a new problem; the maps within the namespace still are blocked, so when I have:
 3
 - 1
 - 2
   -a
   -b
 - 3
 - 4 


the indexmenu skips ”-2” and the pages a and b. Any idea how I get this back into the index?
Grtz Theo

It should not depend on the above skip_index tip as it affects only the “3” namespace, and without more details about your site configuration is impossible to debug the problem. Possible causes are a reference to “2” in the indexmenu skip_index or DokuWiki hidepages regular expression, or the namespace is denied by ACLs. — Samuele Tognini 2009/09/07 17:26

Tag Plugin Support

This would be great if you could integrate support for the tag plugin.

An example of the output could be something like this:

User Defined Title (Items Matching Tag1, Tag2)
-Page Name (Matching Defined Tags)
-Page Name (Matching Defined Tags)
etc.

Request: quick way to sort headpages

Add a handy option to configmanager so you can set the headpage sort always above the list. Now you need {{indexmenu_n>N}} to arrange the headpage and I have to much headpages to add that manual.

Request: move pages and namespaces

Use indexmenu to move pages and namespaces. It would save a lot of time when tidying the wiki up.

Request: wrap tree nodes

When page titles are very long, and you don't use scrolling, the page titles are truncated. It would be nice if they would be wrapped to the next line with the correct level of indentation.

Sorry but it can't be done without full rewriting the indexmenu code.

nojs: How make all namespaces always switching open/close by clicking?

How can I change the indexmenu so that all clicking on namespacelinks opens or close that part of the tree in the nojs mode? Now only when nonexist a headpage in that namespace you get this open/closing-function, but I like it open/close also when there is the headpage in the namespaces. Thus the same style as the Index uses. Can someone help me? — Klap-in 2010/01/07 21:43

You can't. Headpages are not expandable just to permit to click and go to the corresponding DokuWiki page. I could look for a solution for the next releases, so any suggestion about this issue is well accepted. — Samuele 2010/01/08 11:19
I'd certainly like this to be consistent, as it stands it's rather confusing - click on a namespace that has a 'start' page and it opens the start page, click on a namespace that doesn't have a start page and it shows/hides the pages in the namespace. I'd like click on namespace to either hide/unhide the pages in the namespace (if there aren't any then do nothing) or open/close the start page (if there isn't one then 'create page' will appear).

Request/Question: Possible to limit number of items displayed?

Is it possible (or would it be possible to add) a way of limiting the number of items displayed? I want to be able to display the latest n articles. I.e. I want for example to show just the last 20 articles that have been changed.

How to clean up dead links?!

As I've got described in the DokuWiki Forum http://forum.dokuwiki.org/post/17408 I have dead links in the Indexmenu after I moved a page. Is there a way to clean up that entries? Cheers and thank you, David – crazydave 2010/02/17 15:39

I guess that pagemove plugin does not remove parent directory when a page is moved.
What happens in this case is explained in the first item at about_empty_namespaces.
Try to manually delete empty folders in your filesystem, purge the server/client cache and reload the indexmenu page. — Samuele 2010/02/17 16:12

Every namespaces or pages show the menu of their root namespace?

I have follow namespaces and pages

Root
 ├─ns1
 │  ├─ns1.1
 │  │  ├─pg1
 │  │  └─pg2
 │  └─ns1.2
 └─ns2
    ├─ns2.1
    │  ├─pg3
    │  └─pg4
    └─ns2.2

No matter in ns1、ns1.1、pg1、pg2 or even ns1.2, I want them to show follow menu

 ns1
  ├─ns1.1
  │  ├─pg1
  │  └─pg2
  └─ns1.2

so does ns2, in ns2、ns2.1、pg3、pg4、ns2.2, their menus should be:

 ns2
  ├─ns2.1
  │  ├─pg3
  │  └─pg4
  └─ns2.2

It means every namespaces or pages show the menu of their root namspace, is that possible? I come from Taiwan and sorry about my bad English, hopes you can know what I said. thank you. — arst 2010/03/08 12:58

I guess you need the context option. Check the indexmenu syntax for additional info, this is a quick example:
{{indexmenu>.#1|js context}}
No, the result is not what I want. Let me try to explain again.
Root
 ├─ns1
 │  ├─ns1.1
 │  │  ├─ns1.1.1
 │  │  │  ├─pg1
 │  │  │  └─pg2
 │  │  ├─pg3
 │  │  └─pg4
 │  └─ns1.2
 │     └─pg5
 └─ns2
    ├─ns2.1
    │  ├─pg6
    │  └─pg7
    └─ns2.2


In ns1、ns1.1、ns1.1.1、pg1、pg2、pg3、pg4、ns1.2、pg5, their menus will show the complete menu of ns1:

ns1
 ├─ns1.1
 │  ├─ns1.1.1
 │  │  ├─pg1
 │  │  └─pg2
 │  ├─pg3
 │  └─pg4
 └─ns1.2
      └─pg5


Thank you.

Uhm, sorry but this is not supported. A different point of view could be to look for a plugin or template which differs the sidebar page depending on current namespace (like the multitemplate for templates) but I don't know if it exists. — Samuele 2010/03/09 09:29
oh no~~I really love this plugin, hope further releases will support such feature.:-(
arst 2010/03/09 16:22
After few days passed, I got a idea that maybe can achieves my request.
I think I can add the follow code by modify the source code that every pages can be applied.
{{indexmenu>:%RootNamespace%|js}}


%RootNamespace% means the root namespace of current page(not the default site root namespace:start)
But after a few days tried, I still can figure out where is the source code that need to be modified, hopes someone can help me out.

I really want to do it on my wiki pages. now I'm using the markgard-gtopia-wiki template. I don't know if there's a way to do like it now.Can someone help me?

Disable the Toolbar Button?

I'm using this plugin on just one page. I don't need the toolbar button and I'd rather not have my users see it. Is there any way to disable the toolbar button?

Problem with titles

I have problem with titles.

IndexMenu display only names of namespaces/pages (with all small letters), not first section title like here (with Big letters and spaces)

http://samuele.netsons.org/dokuwiki/doku.php?id=playground:playground#sort_pages_and_namespaces_by_title

What I should change to enable IndexMenu to view titles (first page header) instead of pages names?

Edit:

I found solution here:

The trick is that useheading is a GLOBAL DOKUWIKI setting not related to indexmenu. Somehow, I overlooked that, and everyone else probably does too :(

Question:

Could you please give some additional informations? I set the variable 'useheading' = 1 in dokuwiki.php (“1 : use first heading text in all links”, according to manual) but the directories still appear in namespace style (lowercases, no special characters)

Change the pass of indexmenu

there is a solution for indexmenu list attachments?

What do you mean with “list attachments”?

Would it be possible to sort on Page ID rather than page name?

If I could sort on page ID then I can create pages 01, 02, … 12 for the months January through to December and give them headings so the actually appear as the month names in the indexmenu but are sorted in the correct order.

I think indexmenu already sorts (by default) by page ID doesn't it?

I have a similar/supplemental problem though, I'm successfully using a 'meta' sort to custom order
some pages/namespaces but I want the rest to be sorted by page ID. This doesn't seem to work
although the indexmenu documentation seems to say quite clearly that it should. My indexmenu
entry is:-
    {{indexmenu>.:..:..:#1|navbar context nsort msort}}

Further sorting problem - how to sort namespaces?

Is there any way to customise the sorting of namespaces? I have a wiki with only namespaces at the top level and I want to sort them in a custom order rather than alphabetical. Is there any way of doing this?

Issue with Vector Template

I do not know if this issue is due to template or the plugin just wanted to register this

 Indexmenu in Vector template

 Index menu in default template

As you can see there is a border in the TOC (when we use the vector template) getting displayed which makes it un-readable in many cases. Is there any quick fix to this it will help.

Thank you. Yndesai

Indexmenu Toc can be styled using the “indexmenu_toc” and “indexmenu_toc_inside” css classes. Supposing that the problem is a “border” attribute inehreited by the class, you could fix it for example adding in your site css files or directly in the indexmenu css file (in the last case, any plugin update will override your changes):
.indexmenu_toc .indexmenu_toc_inside *{
   border: none;
   padding: 0px;
}
remember to purge cache after changes following steps 4,5 described in the tree is not displayed. — samueleSamuele
samuele

2010/12/31 14:24

nojs: Highlight current page

Great plugin! One thing that I miss is highlighting the current page with the nojs option. But I was able to hack syntax/indexmenu.php in version 2009-08-29 (4.6) as follows to make it work:

  /**
   * Index item formatter
   *
   * User function for html_buildlist()
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   * modified by Samuele Tognini <samuele@netsons.org>
   * modified by Rik Blok to support highlighting of current page in index [2011-02-27]
   */
  function _html_list_index($item){
    global $INFO, $conf;	// needed to highlight current page [Rik Blok, 2011-02-27]
    $ret = '';
      $navsel = $item['id']==$INFO['id'] || ($item['id'].':'.$conf['start'])==$INFO['id'];  // is current page? [Rik Blok, 2011-02-27]
      if ($navsel) $ret .= '<span class="search_hit">';  // highlight if current page [Rik Blok, 2011-02-27]
    //namespace
    if($item['type']=='d' || $item['type']=='l'){
      $link=$item['id'];
      $more='idx='.$item['id'];
      //namespace link
      if ($item['hns']) {
	$link=$item['hns'];
	$tagid="indexmenu_idx_head";
	$more='';
      } else {
	//namespace with headpage
	$tagid="indexmenu_idx";
	if ($item['open']) $tagid.=' open';
      }
      $ret .= '<a href="'.wl($link,$more).'" class="'.$tagid.'">';
      $ret .= $item['title'];
      $ret .= '</a>';
    }else{
      //page link
      $ret .= html_wikilink(':'.$item['id']);
    }  
    if ($navsel) $ret .= '</span>';  // close highlight if current page [Rik Blok, 2011-02-27]
    return $ret;
  }

It simply compares each page as the index is being built to the current page and marks it as a search result if they match. — Rik BlokRik Blok
rikblok

2011/02/28 01:58

ACL Problem

Hi, i've installed your plugin as left sidebar (menu.txt in wiki root) and granted users following permissions:

*	@ALL	1
*	@user	1
tis:*	@tis	8
tis:*	@ALL	0
wellview:*	@ALL	0
wellview:*	@tis	8

Permissions itself works fine (i.e. users in “user' group cannot access tis and wellview namespaces), but even unathorized users can see all existing namespaces in indexmenu.

My conf. is:

$conf['sneaky_index'] = 1;
$conf['plugin']['indexmenu']['only_admins'] = 1;
$conf['plugin']['indexmenu']['aclcache'] = 'user';
$conf['plugin']['indexmenu']['headpage'] = ':index:';
$conf['plugin']['indexmenu']['skip_file'] = '/(menu)/';

$conf['useacl'] = 1;
$conf['cachetime'] = 0;

This is my menu.txt:

{{indexmenu>..#1|js navbar tsort nocookie id#random}}

I've tried different acl_cache options, cleaned my browser cache, tried ?purge=true - still no change. What i need is: all unathorized users and users in “user” group musn't see “tis” and “wellview” namespace in indexmenu, it must be available only for users in |tis” group.

Can you give me an advice of what am i doing wrong? :)

Incompatibility with Rincewind

Indexmenu occurs with DW2011-05-25 'Rincewind'. Indexmenu doesn't work on Rincewind.

How can I make it work? — erialerial

2011/05/27 07:03

Yeah, I like to know too

Yes, I also hope Indexmenu works in 'Rincewind'!

— It worked for a while for my DW… seems I touched too many things now I'm troubleshooting why it has gone bad :( juanperiz AT yahoo DOT com DOT ar

Tree only expanding to level 6

Indexmenu expands the tree only up Level 5 from the Root, but we would need levels 7-10 also to be displayed, as their names are really short.
Also setting max#3#1 or maxjs#10 doesn't solve the issue - under the 6th level the “Empty”-Icon is diplayed.
Can we somehow manage to set the maximum number of tree levels for the whole menu? — bro [at] ditech [dot] at 2011/09/02 10:12

Incompatibility with Angua

The js Version does not open the indexmenu to the current page. It stays closed. Even telling it to expand one level per default does not work. This seems to only affect the js Version. The standard Version seems to work ok, except that it does not seem to expand beyond a certain level, which is a bummer also. Basically it is at this time of writing useless with Angua :(

Try invalidating the Cache by touching config/local.php and/or doku.php, that fixed it for me.
The only Problem I am havong is, that the TOC-Preview is moved about 300px up and left, so you can't really see from which Node you opened the TOC.
b [dot] rosner [at] ovido [dot] at 27.12.2011 17:37
I managed to fix issue with TOC-Preview position:
--- /srv/www/htdocs/dokuwiki/lib/plugins/indexmenu/script.js    2009-09-19 10:54:44.000000000 +0300
+++ /srv/www/htdocs/dokuwiki_ref/lib/plugins/indexmenu/script.js        2011-12-29 13:07:03.379880000 +0300
@@ -72,8 +72,8 @@
 function indexmenu_showPicker(pickerid,btn){
     var x = 3, y = 3, picker = $(pickerid);
     if(picker.style.display == 'none'){
-       x += findPosX(btn);
-       y += findPosY(btn);
+       x += jQuery(btn).offset().left; //findPosX(btn);
+       y += jQuery(btn).offset().top; //findPosY(btn);
        if (picker.id != 'picker_plugin_indexmenu') {
            x += btn.offsetWidth-3;
        } else {


While I had issues with TOC synchronization it has disappeared on itself. So probably related to caching.
Denis 29.12.2011 15:25

Hi Denis - The Fix is working great, thanks for sharing!
The only issue left is thar the right-click Menu isnt working anymore. — b [dot] rosner [at] ovido [dot] at 01.02.2012 13:14

Excessive Tooltips

There is tooltip shown for each menuitem which is identical to the element itself. I think it is annoying and excessive. So I propose to leave title attribute empty:

--- /srv/www/htdocs/dokuwiki/lib/plugins/indexmenu/indexmenu-full.js    2009-09-19 10:54:44.000000000 +0300
+++ /srv/www/htdocs/dokuwiki_ref/lib/plugins/indexmenu/indexmenu.js     2011-12-29 14:42:01.192652000 +0300
@@ -102,7 +102,7 @@
     str += '>';
     if ($('dtree_'+this.obj)) {str += '<div class="error">Indexmenu id conflict</div>';}
     if (this.config.toc) {
-       str += '<div id="t' + this.obj + '" class="indexmenu_tocbullet '+this.config.theme+'" style="display:none;" title="Table of contents"></div>';
+       str += '<div id="t' + this.obj + '" class="indexmenu_tocbullet '+this.config.theme+'" style="display:none;"></div>';
        str += '<div id="toc_' + this.obj + '" style="display:none;"></div>';
     }
     if (this.config.useCookies) { this.selectedNode = this.getSelected(); }
@@ -169,7 +169,7 @@
        str += '<a id="s' + this.obj + nodeId + '" class="' + ((node._cp) ? 'navSel' : ((node._is) ? 'nodeSel' : (node._hc) ? 'nodeFdUrl' : 'nodeUrl')) ;
        str += '" href="' + this.config.urlbase;
        (node.hns) ? str +=node.hns : str += node.dokuid;
-       str += '"' + ' title="' + node.name + '"' +jsfnc;
+       str += '"' + jsfnc;
        str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';
        str += '>'+node.name+'</a>';
     }

Note that I renamed indexmenu-full.js to indexmenu.js to be able to edit it.

Denis 29.12.2011 15:43

Not compatible with hidden

Having this plugin installed means that hidden doesn't work (no folding occurs). I don't think this used to be the case, maybe it changed when I installed a new version of DokuWiki. — Stian 27.01.2012 12:40

wiki sitebar/index webpage loads with errors in IE8/9

Description: wiki page in IE does load but with following errors

Message: 'length' is null or not an object
Line: 1 Char: 23115 Code: 0

Message: Object doesn't support this property or method
Line: 1 Char: 12944 Code: 0

Details: Template used: vector

plugin»indexmenu»page_index = :wiki:sitemap

this page has content

{{indexmenu>..#2|js navbar nocookie id#random maxjs#2}}

tpl»vector»vector_navigation_location = :wiki:navigation

this page has content

{{indexmenu>..#2|js navbar nocookie id#random maxjs#2}}

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; InfoPath.3)

RESOLUTION: in fact none, the root cause was a problem with DokuMicroBugTracker, possibly there is conflict with some plugin. I also removed the nocookie option.

MartinM 3.02.2012