« 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:
  • Open the Firefox error console and clear all messages with the “Clear All” button
  • Load an indexmenu page and check for error messages (not the yellow warnings, but the red errors)
  • Errors messages should also display a link of js files with errors. Click it to go to the js code which originated the error. Report the file path and the code (trimmed if too long).
  • Then clear again the error console and right click for the indexmenu context menu.
  • Check for new error messages as in the above step.

Following the above steps, I get the following messages:

  • Loading an indexmenu page
    • Multiple errors with p.onStatusChange is not a function. Line 519 of chrome://browser/content/tabbrowser.xml: p.onStatusChange(aWebProgress, aRequest, aStatus, aMessage);
    • Error in parsing value for 'cursor'. Declaration dropped. in doku.php
  • Right clicking
    • Use of getBoxObjectFor() is deprecated… (same as above) in doku.php

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

A way to solve it is by add on headpages {{indexmenu_n>1}} and use the options {{indexmenu>namespace| msort tsort}}. But it is much work to apply that to all pages and there appear every time new pages so it holds work.

Is there already a way to do this handy or do you have a suggestion how I can improve my situation? – Klap-in

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

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

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?

 
plugin/indexmenu/discussion.txt · Last modified: 2010/03/12 14:22 by arst
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate