indexmenu plugin by Samuele Tognini
Show a customizable and sortable index for a namespace.
Last updated on 2009-01-04. Provides Syntax.
Compatible with DokuWiki 2003-09-03, 2008-05-05.
Conflicts with indexmenu2, lightboxv2!
Similar to alphaindex, indexmenu2.
This plugin allows you to insert a customizable index or a list of pages starting from a specified namespace. It should be useful in DokuWiki sites where pages are organized by namespaces. Main features are:
The indexmenu plugin is not sponsored by anyone but i develop and support it for free during my spare time. If want to offer me a friendly beer 1), you can consider to make a donation.
Arguments inside ”[]” parenthesis are optional:
| Main | Options |
|---|---|
| {{indexmenu>ns[#n] [ns1[#n] ns2[#n] …] | | [js[#theme]] [tsort] … }} |
Settings before the “|” separator:
| Main | Action | Note |
|---|---|---|
ns | Main namespace name. Index starts from it. | “.” refers to the namespace of the indexmenu page (not the current page displayed by a user who is navigating your site); ”..” or an empty value shows the root site namespace; ”.:myns” is the myns namespace inside current namespace of the indexmenu page. |
n | It's a number which specifies how many subnamespaces to display. With the js option it means at which level the tree has to be open | Optional; it can be used together with nons. If it's not defined then all namespaces are open, if 0 or 1 they are closed. |
ns1[#n] ... nsn[#n] | A list of optional namespaces inside the main namespace. Every namespace will be opened or closed at the specified n level. | Optional. It can be used together with nons. If n is not defined then all namespaces are open, if 0 they are closed. |
Settings after the “|” separator:
| Option | Action | Note |
|---|---|---|
js | JavaScript render method: the index is an expandable tree menu. | Optional; without n, all nodes are open, with it, nodes are open till n level. |
navbar | The tree opens itself automatically at the current page namespace. Useful in a navigation sidebar. | It works with or without js option. Without js option, the indexmenu page is never cached (just like as the default DokuWiki index page) so the dokuwiki loading could be slower depending on the amount of child nodes displayed. |
context2) | Dynamically shows the tree of the current dokuwiki namespace context (in other words, the namespace tree of the current page displayed by a user who is navigating your site). Useful in a navigation sidebar. | It works with or without js option. In both cases, the indexmenu page is never cached so the dokuwiki loading could be slower depending on the amount of child nodes displayed (As js mode usually displays a lot of them, the max option is recommended) |
tsort | Sort (only) pages by title. | Useful when useheading is on. See the nsort option for namespaces sorting. Optional. |
dsort | Sort (only) pages by date creation. | See the nsort option for namespaces sorting. Optional. |
msort[#meta] | Sort (only) pages by a custom metadata information. Without the optional meta parameter, it will use the custom sorting number specified with the {{indexmenu_n>N}} syntax (read below for more info). meta should refer to the data structure (Array values are managed through the ”:” separator, for example: “msort#date:modified). | You can use the tsort/dsort option together with msort in order to sort pages without metadata tag in a different way from the default DokuWiki one (sorted by page name). See the nsort option for namespaces sorting. Optional. |
rsort | Reverse the sorting of pages. | Optional. |
nsort | Sort also namespaces according to the previous sort options. | Optional. |
nons | Exclude namespaces nodes from index. It shows only the pages. | Optional. |
nopg | Exclude pages nodes from index. It shows only the namespaces. | Optional. |
max#n[#m] | The node at n level will retrieve all its child nodes through the Ajax mechanism. Optionally, instead of retrieve them in one time, it can retrieve them with Ajax every m sublevels. | Optional. Cookie are automatically disabled, just like with noocookie. It affects the server loading and speeds up the loading of page in DokuWiki's with an high amount of pages. It works only in js |
theme | Theme name for indexmenu icons | A theme is a set of icons inside images directory as described in Theme tutorial. Admins can download and share themes in admin panel. It works only in js |
id[#random|n] | Cookie id for a js indexmenu. By default is random, but you can force it to be a n fixed number ( i.e id#20 ). | Useful only when you need two or more navbar tree or when a page is uncached and you don't use the nocookie option. Read the Js does not remember its previous state section. ATTENTION: id must be unique for every indexmenu in your DokuWiki site or you'll get strange js behaviors. It works only in js |
maxjs#n | It sets how many js tree levels to render when page loads. Remaining nodes are rendered (slightly slower) only when they are open by users, by optional namespaces option, by cookies or by navbar option. | Default n is 1 so that it will speed up the page loading, above all with an high amount of pages. It affects only the user-client CPU speed, not the webserver load. It works only in js |
nocookie | By default js indexmenu remember selected,open and closed nodes by user during navigation. With this option it doesn't remember them and the tree is blocked to its start status. | It works only in js |
noscroll | Disable the JavaScript scrolling feature. It could solve visualization problems. | It works only in js |
notoc | Disable the TOC-preview feature. | It works only in js |
By default nodes are sorted by page name (or by title/date if you use the tsort/dsort syntax), but you can also specify a custom sort number for every page inserting a metadata tag in the pages with this syntax:
{{indexmenu_n>N}}
Where N is a number. Then you need to use the “msort” option in your indexmenu tree syntax.
For example you can change the order of this tree:
-Root |_Don |_Van |_Vliet
in this way:
-Root
|_Vliet {{indexmenu_n>1}}
|_Van {{indexmenu_n>2}}
|_Don {{indexmenu_n>3}}
Pages without metadata information are sorted by page name if you don't use the tsort or dsort option in this way:
{{indexmenu>..#1|tsort msort}}
A sample of an indexmenu that could be used inside a navigation sidebar. Its initial status is blocked by the nocookie option, so, when the page is reloaded, it doesn't remember the open and closed nodes by the user.:
{{indexmenu>..#1|js navbar nocookie}}
Sample navigation bar where nodes after the third level are retrieved with Ajax every 2 sublevels:
{{indexmenu>..#1|js navbar max#3#2}}
Standard DokuWiki index showing only pages inside wiki:plugins and lower namespaces (max two levels):
{{indexmenu>wiki:plugins#2|nons}}
On 2003-09-03 DokuWiki, before upgrading indexmenu through plugin manager be sure to update the download link, because new indexmenu will not work on the old DokuWiki.
Download the zip file and unpack it into lib/plugins folder or use the plugin manager. |
| Mirror link: http://Xxoomer.alice.it/satogni/misc/indexmenu.zip (Remove the first X). |
Development release contains features and bug fixes that will be in next public release and it should be used for development purposes. Unlike the stable release, included JavaScript files are not compacted so the network load is a little bit higher. Even it should work concerning indexmenu main features, use it only on a test environment or after a backup of your site data.
My site is always based on this release.
The version returned by the development release is always the same of the stable one so upgrading from stable to development with plugin manager does not work. Before installing the development release be sure to have first manually deleted the old indexmenu directory. Also be sure that, as last step, server/client cache is purged following 4 and 5 of the the_tree_is_not_displayed section.
If you're interested, there's also an indexmenu darcs repository.
darcs get --partial http://samuele.netsons.org/darcs/indexmenu
To create a patch, go in your downloaded indexmenu directory and:
#Check for new patches and install them: darcs pull #Modify source files creating your own patch and record it with: darcs record #Send the patch to me via mail: darcs send
Indexmenu v2.7 compatible with old 2003-09-03 DokuWiki version.
Download the 2003-09-03 zip file and unpack it into lib/plugins folder or use the plugin manager.
Create the folder indexmenu in DokuWiki /lib/plugins directory 3)and refer to its source code for files to create.
Create the indexmenu subdirectories images/default and put inside it the icons set at Dtree site and create the lacking ones following the Theme tutorial scheme.
Indexmenu is fully configurable from Configuration Manager.
Indexmenu compatible with old DokuWiki 2003-09-03 needs to be configured through /conf/local.php configuration file (values are explained below).
First of all, if you want that the tree displays the heading title of pages instead of the their name, you need to set the useheading on.
Then, with the headpage global option, you'll be able to set from which pages retrieve titles.
Every namespace will retrieve its title from the heading title of a page, called headpage, and will be linked directly to it.
You can choose a name for the page from which retrieve the title or use a special value:
| Value | Page | Example |
|---|---|---|
| any value | The page inside the namespace | public(ns):myvalue(page) |
| :inside: | a page with the same name of namespace, beneath the namespace | public(ns):public(page) |
| :same: | a page with the same name of namespace, at the same level of the namespace | public(page) ⇔ public(ns) |
| :start: | the global start page name inside the namespace | public(ns):start(page) |
You can specify more than one option using ”,” as separator. For every namespace, every value will be checked till the first existent headpage is founded.
To get a better visualization you could use the hide_headpage option, that hides headpages in the rendered indexmenu tree.
/conf/local.php for DokuWiki 2003-09-03:
//it will check first for pub(ns)=pub(page), then pub:jack, than pub:conf_start. $conf['plugin_indexmenu']['headpage']=":same:,jack,:start:";
/conf/local.php for DokuWiki 2003-09-03:
$conf['plugin_indexmenu']['hide_headpage']=true;
Optimize the cache of indexmenu according to ACLs. More info about ACLs can also help.
The choice of the method affects only the visualization of nodes on the indexmenu tree, not the page authorizations. The Groups option is the default setting.
A page that will replace the main DokuWiki index. Create it and insert the indexmenu syntax. Use id#random in indexmenu options if you already have an indexmenu sidebar with navbar option. My suggestion is:
{{indexmenu>..|js navbar nocookie id#random}}
You can skip namespaces through the skip_index option. A namespaces full path has to be declared as a file system path (i.e.: “mydir/mysubdir”). It supports Regular Expression.
There are also some issues About empty namespaces that should be read.
/conf/local.php for DokuWiki 2003-09-03:
//It will skip any discussion,wiki or playground namespace. $conf['plugin_indexmenu']['skip_index']="/\/(discussion|wiki|playground)(\.\w+)?$/i";
With the skip_file option you can skip also pages. Pages are checked as DokuWiki text files (i.e.: start.txt). A page full path have to be declared as a file system path (i.e.: “mydir/start.txt”). It supports Regular Expression.
what is “mydir” ? Path given through realpath() ? path from public_html root ? path from dokuwiki root ?
answer : path from public_html root if on a web server.
What should be entered in configuration manager to skip a dokuwiki root file list likefile1.txt; file5.txt; file9.txt; file14.txt;
answer :/file1|file5|file9|file14/
OK now same question if I want to skip “lastname” page but have “firstame lastname” page in my index ?
Answser :/^\/\/lastname.txt$/
There are also some issues About empty namespaces that should be read.
/conf/local.php for DokuWiki 2003-09-03:
//It will skip any copyright or navigation page. $conf['plugin_indexmenu']['skip_file']="/(copyright|navigation)/i";
I installed the latest version (DokuWiki 2007-06-26b) and was not able to 'skip files'. The correct code is
// in /conf/local.php $conf['plugin']['indexmenu']['skip_file'] = '/(copyright|navigation|syntax|site|dokuwiki)/i';
You're right, but that note is for the old 2003-09-03 DokuWiki. Last DokuWiki has got a setting manager interface that simplifies the manual code adding.
From 3.1 release, message supports the wiki syntax, so it's fully customizable. Don't use HTML code.
You can show a custom message in place of the menu tree if it can not be rendered (i.e namespace doesn't exist):
/conf/local.php for DokuWiki 2003-09-03:
$conf['plugin_indexmenu']['empty_msg']="Sorry, no menu for <b>{{ns}}</b>"; //write your message here
{{ns}} is an alias for the requested namespace.
One useful empty message is
$conf['plugin_indexmenu']['empty_msg']="<br><ul><li>No pages yet.</li></ul>"
This makes the empty indexmenu look like a list (and therefore look closer in style to non-empty indexmenus).
It prevents no-admin users to insert indexmenu trees, removing every indexmenu syntax in the page. It affects only the edit mode, so that no-admin users are still able to view indexmenu tree in a page edited by admins.
You can install new icon themes for JavaScript indexmenu, share your own theme and check for plugin updates in the admin panel.
The JavaScript tree menu is based on dTree code and is called with the js option. without theme option, JavaScript indexmenu will use the default theme.
Inside the Admin panel there is the option to download js themes from my site, and to share your own themes, sending them to me.
To download themes directly into your DokuWiki server, you need that indexmenu images directory is writable by web user. Anyway, you can download themes into your pc form the download link, and then install manually.
You can create custom themes for every index rendered with the dTree menu.
Simply create a subdirectory, for example mytheme, inside indexmenu/images.
Put inside it your icons following the default theme scheme.
Main icons are:
| Icon | Type |
|---|---|
| base.gif | Root Folder |
| folderopen.gif | Open folder without URL link |
| folder.gif | Closed folder without URL link |
| folderhopen.gif | Open folder with URL link (headpage) |
| folderh.gif | Closed folder with URL link (headpage) |
| page.gif | Page |
Other secondary but needed icons are:
| Icon |
|---|
| plus.gif |
| minus.gif |
| nolines_plus.gif |
| nolines_minus.gif |
| minusbottom.gif |
| plusbottom.gif |
| join.gif |
| joinbottom.gif |
| line.gif |
| empty.gif |
Use your theme with js#mytheme syntax.
You can also customize a theme style by creating its own style.
The default icons file format is GIF, but PNG and JPG are also recognized. To use them in place of GIF, you have to name your theme directory with the appropriate image extension. For example: Mytheme.png/base.png.
An action menu is displayed when using the context mouse menu click (the right one in many cases). On Opera you can use the CTRL+left click to display it. When in editing mode, by default an “Insert as DWlink” item menu is added to the menu in order to insert the node DokuWiki link in your editing box.
A different context menu is loaded depending on anonymous, authenticated or admin users.
You can fully customize those menus by editing these files in the 'the indexmenu/jsmenu' directory:
| File | Loaded by |
|---|---|
| “menu.js” | anonymous user |
| “usrmenu.js” | authenticated user |
| “admmenu.js” | admin user4) |
To prevent to load the context menu, simply remove the indexmenu_contextmenu variable declared in the above menu files.
How to write utf8 chars, like èåäö, in the context menu file?
A solution is to encode them yourself: Find your char at http://unicode.coeurlumiere.com, replace the last zero of the left code by the character in the upper row and prepend the result with \u : i.e. \u00E3 for 'ã'
You can edit the style.css in order to globally customizing the tree menus style. Some styles are:
| Tag | Comment | Mode |
|---|---|---|
| a.nodeFdUrl | Namespace with URL link (headpage) | js |
| a.node | Namespace without URL link | js |
| a.nodeUrl | Page | js |
| a.nodeSel | Previuos selected page or headpage highlight | js |
| a.navSel | Current page highlight | js |
| a.indexmenu_idx_head | link style of a namespace with URL (headpage) | nojs |
| a.indexmenu_idx | link style of a namespace without URL | nojs |
| .indexmenu_arrow | The scrolling arrow area | js |
| .indexmenu_toc | The toc-preview area | js |
If you want to apply a different style from the global one to a js theme, you need to create a style.css file like this inside the theme directory you want customize and use its name as subclass.
/*Custom style for the thread theme*/ .dtree .thread{ font-family: Comic Sans MS; } .dtree .thread a.navSel { background-color: #000; color: #fff }
If your site contains a large amount of pages, and you're using indexmenu as a navigation sidebar, you could notice random slowdowns in the page loading. This happens when cache is purged and the whole indexmenu tree has to be rebuild.
To avoid this problem you may use the max option, which rebuilds only a single tree portion (sublevel) and enable ajax for further user-requested sublevels.
I'm trying to use the msort feature of indexmenu and it is working as expected except for one side-effect: on any page where the {indexmenu_n}} option is defined I see a blue “Info” bar with something like “Indexmenu sort number: 2” at the top of the wiki page.
The browser is Mozilla Firefox 2.0.0.12. The problem does not occur on IE 6. Also it doesn't appear on the latest version you've got installed on the test site. FYI I'm using DokuWiki version 2007-06-26b with Monobook 07202007 template.
I've tried [en|dis]abling debugging using $conf['allowdebug'] = 0; to no avail. Any suggestions?
— SSMC Feb-18-2008
Sorry, but I forgot to add its explanation in this wiki. The sort message is displayed only to wiki admins and it's useful to check your pages order. Anyway, you can disable it also for admins by unchecking the indexmenu show_sort option in the Configuration manager. — Samuele Tognini 2008-02-18 19:30
Thanks! That explains the on-again-off-again observations using different ids. I didn't make the connection though as I have some local browsers with auto-login as an admin for working. Thanks again. — SSMC
These new sort options (tsort, msort, nsort) are fantastic! Just wondering if there is a way to change the defaults, so that if nothing else is specified, a certain set of sort parameters are used automatically. For example, we have a wiki where we will always use the msort tsort nsort options together (in every instance of indexmenu). So instead of defining something like:
{{indexmenu>.|msort tsort nsort}}
100 times, we could just say:
{{indexmenu>.}}
This would make things easier for rookie editors, and ensure consistency. Just curious if it's feasible in some way.
Cheers! —Ryan Jacobs 2008-03-01
Currently there is no way to set these defaults. To force them (but then there will be no way to unset them), you should hack the 'syntax/indexmenu.php' handle function:
$match = substr($match,12,-2); + $match .= ' msort tsort nsort';
— Samuele Tognini 2008-03-03 23:44
Thanks, that's exactly the kind of detail I was looking for. I know it's a “hack”, but in some circumstances consistency will be more important than heaps of options for every instance of indexmenu.
Thanks! —Ryan Jacobs 2008-03-04
I have in my sidebar the following code
{{indexmenu>..#1| js navbar id#random }}
and I get after saving this message: Indexmenu id conflict
What's wrong????
The IE also doesn't remember tree state after open a page With Firefox it works
A conflict happens when there are two indexmenu tree with the same id in a web page. If you're using only one indexmenu with the below syntax then it could be a cache issue. Have you tried with the The tree is not displayed steps? Let's continue this discussion here but, please, next time report bugs in the appropriate bug section. — Samuele Tognini 2008-02-20 17:33
I forgot to say that this obviously happens when you are editing your site sidebar page, too. In this case you get the same indexmenu object in both page and sidebar and the conflict is detected. — Samuele Tognini 2008-02-25 13:05
Thanks. I have tried it with The tree is not displayed, but with IE indexmenu doesn't remember the tree state after open a page. The theme shows a open directory with the minus but all the tree's are still closed —Werner Stoiber 2008-03-07 14:20
Could you try the development release (after installed, purge the cache following The tree is not displayed steps)? If nothing change, could you send me you site URL so I can test it? If it's not public accessible, a screenshot could help. — Samuele Tognini 2008-03-07 18:34
I've tried the development release. with the same result. I've sent you the screenshot with mail. Thanks Werner —Werner Stoiber 2008-03-19 12:45
It took me some extra explanations from Samuele to get that : id conflict will always ocur as long as sidebar AND index are the same page. To avoid it, make a page for index, and another one for sidebar (even if they have exactly the same content
) — NewMorning 2009/02/11 22:45
Yes, with the tsort,dsort or msort syntax options.
If you want to replace the default navigation with sidebar, please note that you
a) need a template that actually has some sort of “sidebar”
b) probably need to set the “page that's used as navigation” in the template config and put inside that page the indexmenu syntax , for example for 'dokubook' this is:
$conf['sb_pagename'] = 'wiki:navigation';
I would like to have the indexmenu on the left side (similar to the default “table of contents” on the right). On Samuel's Playground-Page is a very fine example of what I mean. I mean the box on the left-side with the title “DokuWiki”. When I view the source-code it is<div class="left_sidebar">Where do I have to edit my stylesheets to activate this on each page? 2007-02-06 10:51 CEST(Austria) Mark
Indexmenu itself does not provide sidebars, but you need a template that supports it. You can find them in Template page. I suggest you to look for a template that uses a page as sidebar, so that indexmenu loading will be faster thanks to DokuWiki cache. Mine is the artic template. — Samuele Tognini 2007-02-06 11:58
do you mean Arctic (because I found no “artic”)?
Yes
ok, thanks a lot, now it works; I used sidebar template and the I created a page called “sidebar”# my page "sidebar" has only this entry: {{indexmenu>.|js#kde.png navbar}} # in conf/local.php # I added the entry $conf['template'] = 'sidebar';I use the KDE-theme; it looks really great! 2007-02-07-09:48 CEST (Austria) markjackson
Question from Jen: Is there any way to create this sidebar functionality for only part of a wiki site? In other words, I only own a particular directory/namespace and would like to use the indexmenu sidebar, but I cannot change the global conf/local.php.
Sorry but you can't, at least only through indexmenu, because it does not provide sidebar functionality. Sidebars are provided by templates, and only administrator can manage them.— Samuele Tognini 2007-04-04 11:45
One more question? Where does the sidebar page go?
Thanks, Jen
It depends on template. For example, the arctic template lets admin to choose any wanted DokuWiki page as sidebar.
New question: Editing the sidebar page displays the sidebar tree as links in wiki syntax. I created a sidebar page, switched from the WYSIWYG editor to the wiki syntax editor and placed the following line:
{{indexmenu>.|js#kde.png navbar}}.
Saved the page. When I press Edit this Page, I see the menu in the WYSIWYG, instead of switching automtically to the wiki syntax editor.
You should provide me a link to the WYSIWYG editor you are reporting about so I can test the problem. And, please, use the bugs section for indexmenu bug issues.
2007-02-05-07:44 CEST
I have installed indexmenu, but every time I want to use it there is the following error:
Fatal error: Call to undefined method syntax_plugin_indexmenu::getConf() in /<PATH TO MY WEBSPACE>/dokuwiki/lib/plugins/indexmenu/syntax.php on line 143
any solutions or ideas?
Mark Jackson
What DokuWiki version have you installed? Look at dokuwiki_2003-09-03 indexmenu release (no more developed) for old versions.
thanks for this pointer! I had the version 2006-03-09e; now I installed 2006-11-06 and it works!
2007-02-05 10:34 CEST Mark
Or nojs tree is displayed in place of js one.
Or you can not see any new release feature reported in changelog.
Follows these instructions:
If problem still persists, please, report the bug with details of your configuration in bugs section.
Note: Make sure to save the page. The JS tree will not if you only preview the page (at least for me) I can't reproduce this bug, for me indexmenu works on preview too. One reason could be the Firefox bug that I wrote about in the bugs section. Could you check the JavaScript console for errors? — Samuele Tognini 2007-03-09 16:46
| :!:From indexmenu v3.3, the tree is always immediately updated. So you have not to worry to use ~~NOCACHE~~ instruction, it's not useful and slows down the page loading. |
But in older versions when the requested main namespace is not the root, then internal DokuWiki caching mechanism implies that the rendered tree and the namespaces titles could not be updated when you modify a page or create a new one inside that namespace until the server cache is purged.
To purge cache either wait for the automatic purge cache time expiration or force it through a purge=true request on the page that contains the indexmenu tree.
You also might try the ~~NOCACHE~~ instruction to completely disable a specified page cache, so that you have no more to worry about purging cache. But pay attention that it could slow down the overall loading process of the page depending on the number of tree nodes.
Every js indexmenu has an id (randomly generated by default) used by cookies to remember the current tree state (the selected, open and closed nodes). When the page cache expires or is purged, this information are reset because a new cookie (and consequently a new id) is generated.
This is not a problem because cache purge is not frequent, but if indexmenu is called inside an uncached page or directly inside PHP code, every time user loads the page, indexmenu behaviour is to not remember is previous state just like when nocookie is defined.
In this case, the solution is to force a permanent id through the id option. Id can be any number or the string “page”. The last option is used in rare case, because it will generate an id based on the current page. It's important to have unique ids in your site because two menus with the same id will interfere one each other when user open or close nodes.
Create your own arrow in GIF format with an image editor, then override the default one in dokuwiki/lib/plugins/indexmenu/images/scrollleft.gif.
Change the height and width of the .indexmenu_arrow property in the Css Style according to the size of your image.
You could need a browser cache purging.
| :!:You could need to set corretly the Acl cache option in order to correctly avoid displaying of denied pages. |
conf/local.conf:$conf['sneaky_index'] = 0; |
Indexmenu tree behaviour depends on the sneaky_index option, which means:
In both cases, unauthorized pages are never showed. There are also some issues About empty namespaces that should be read.
Example:
+-Mysite (ns) (allowed)
+-private (ns) (denied)
+-ppublic (ns) (allowed)
-ppstart (page) (allowed)
-pstart (page) (denied)
+-public (ns) (allowed)
-linux (page) (allowed)
+-public2 (ns) (allowed)
-secret (page) (denied)
-start (page) (allowed)
-start2 (page) (denied)
Enabled will display:
+-Mysite (dir) +-public (dir) -linux (page) +-public2 (dir **displayed only in case of any sort option**) -X (empty/unauthorized icon **displayed only in case of any sort option**) -start (page)
Disabled will display:
+-Mysite (dir)
+-private (dir)
+-ppublic (dir)
-ppstart (page)
+-public (ns)
-linux (page)
+-public2 (dir **displayed only in case of any sort option**)
-X (empty/unauthorized icon **displayed only in case of any sort option**)
-start (page)
Empty namespace can occur when:
In presence of an empty namespaces, indexmenu will show a node child icon, representing an empty page, when any of the syntax sort options are used or when the max option is configured and the node has to retrieve its children through the Ajax request.
Why do you need a sort option to correctly hide empty namespaces? Because the sort option calling replaces the faster, but less featured, core DokuWiki search with the slower, but more featured, indexmenu search.
| Only for 2006-03-09 DokuWiki version. Not needed in the 2006-11-06 version. |
To avoid indexmenu JavaScript code in RSS feed in order to get it readable, edit the dokuwiki/feed.php file at line 217, inside “cleanDesc” function, and add this line:
//remove TOC + $desc = preg_replace("!<div class='dtree'>.*?</div>!s",'{{indexmenu code}}',$desc); $desc = preg_replace('!<div class="toc">.*?(</div>\n</div>)!s','',$desc
At this moment only English (a not very good English) and Italian are supported, but I'll be glad if you'll want translate indexmenu in your own language and send it to me, with darcs or simply via email.
Strings to translate are in indexmenu/lang/en/lang.php and indexmenu/lang/en/settings.php.
The text used for the nodes in the tree is retrieved from DokuWiki's metadata store. DokuWiki uses a background process triggered by a webbug to updating this metadata.5) If you added wiki pages/namespaces via the filesystem (rather than creating them in DokuWiki,) and that page/namespace has never been viewed, the metadata will not have been generated.
| Before to report a bug, please try the development release. It could already contain the bug fix. |
| You can report bugs here (please,read the faq and notes section before) but you can also contact me via email (and any feedback will be well-accepted).Solved Bugs are moved in oldbugs discussion page. |
It seems that a severe bug of Firefox, under some circumstances, corrupts cached JavaScript files so that a no-js tree is displayed in place of tree one. Purging browser cache solves it. Other browsers are not affected by this bug. Latest indexmenu releases seems not to be affected by this bug.
indexmenu uses a colon as a namespace separator, but on my Windows-Server DokuWiki only works correctly with a slash as a separator. Is it possible anyway, to change the namespace separator in indexmenu? –Thomas
Do you mean the URL namespace separator? Last version should work with it, but you need first to activate the URL rewriting in the DokuWiki configuration. The variables are userewrite and useslash.
Yes, I mean the URL namespace separatorrewriting is activated and also useslash. But I handled the rewriting by ”.htaccess”. If I set it to “DokuWiki” also indexmenu handles the URL. But I want to use htaccess, cause of nicer URLs. Is this possible anyway? –Thomas
DokuWiki userewrite option has also the “htaccess” value. Does not it work (don't forget to set the sepchar)? A workaround is to change these settings in the indexmenu syntax.php as you need:
$out .= "$js_name.config.urlbase='".wl()."';\n"; $out .= "$js_name.config.sepchar='".idfilter(':')."';\n";
Feel free to email me to get support.
I installed this on a test version of DokuWiki and it looked great. When I installed it on my production wikis, I ran into some problems. I could not get the nice JavaScript version to display.
After much troubleshooting (and fixing two other problems related to session.save_path not pointing anywhere in the php.ini and disabled sessions), I was able to get this working on one of the wikis. When I compared the two (they are virtually identical) I noticed that one had the notes plugin while the other did not (I only planned to use it in one of the wikis). The wiki with it enabled was receiving a JavaScript error in firebug with the indexmenu_findExt() function. I disabled notes on the second wiki, and refreshed and it appeared properly. I then re-enabled notes to test if that was indeed causing the problem, but it still seems to work fine now.
So all in all, I'm not sure if there is a conflict or not, or if the order in which I enabled them made a difference?
Just putting this here in case anyone else has a similar problem or can confirm a conflict. Thomas Hawkins 2008/12/18
Hi, I can't reproduce this bug neither in the stable nor in the development DokuWiki release. For example, this test page seems to work.
What's exactly the firebug error message? Be sure also to have purged correctly cache following steps 4 and 5 from The tree is not displayed. — Samuele Tognini 2008/12/19 10:09
I just happened to have an old browser window opened with the error on it. It reads:
indexmenu_findExt is not defined
dTree("indexmenu_1631928460494ad9797f3e8", "default")
start()()start (line 106)
|-------------------------------------...h.max(this.length-1,0);return lstEl;});}
in file: indexmenu.js (line 18)
I did also follow all of the troubleshooting steps listed. It could have been a combination of it all that finally got things working. I also had indexmenu2 installed for a while, and I didn't know initially that they shared a directory. – Thomas Hawkins 2008/12/19
I have just had this problem. I upgraded my wiki from the version of 2008 to the one of 2009, and my indexmenu and my edit toolbar stopped working. I had the error on line 18 of indexmenu as well as another in lib/exe/js.php. Reloading cache didnt work.I disabled the plugin note, reloaded cache and started working. I have a copy of this wiki on a Windows server and I didnt have this problem, I had it on the server run by Ubuntu.
I have reenabled note plugin and now it works fine… wierd– Adolfo Botana 2009/02/20
As i can understand - indexmenu will replace the main DokuWiki index as i write some thing in page_index setting. But replace doesnt work for me. I try to find out where is the bug. And find that script action.php stops in line 131
if (!file_exists(wikiFN($this->getConf('page_index')))) return;
So scripts thinks that there is no file and return :( Maybe I have to create any file manually? How make this feature work? Maybe I'm wrong, but i managed to work this feature by modifying function _loadindex in action.php this way:
function _loadindex(&$event, $param) { if ('index' != $event->data) 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"; //print p_wiki_xhtml($this->getConf('page_index')); if ($this->getConf('page_index')) { echo p_locale_xhtml('index'); $instr = $this->getConf('page_index'); } $instr = p_get_instructions($instr); $info = ''; $instr = p_render('xhtml', $instr, $info); echo $instr; $event->preventDefault(); $event->stopPropagation();
Vychegzhanin Stanislav 2008/12/26
“Replace Index” option in the admin panel has not to contain syntax, but a DokuWiki id page.
For example: Configure it as “mysite:myindex”. Then create this DokuWiki page and put inside it the ”{{indexmenu>..#1|navbar}}” code — Samuele Tognini 2008/12/26 10:46.
This is what happens when I clic on the small dark horizontal triangle at the end of any page or namespace in the index menu : it says “loading” and then appears this message :
Fatal error: Call to a member function query() on a non-object in /srv/d_survie/www/forum.survie.org/htdocs/include/functions.php on line 130
Fixed by Samuele by adding
require_once (DOKU_INC.'inc/common.php');
//require_once (DOKU_INC.'inc/pageutils.php'); // can lead to disconnection if using [[auth:punbb]]
require_once (DOKU_INC.'inc/auth.php');
At line 19, just before
//session_write_close
Fixed in the development release. — Samuele Tognini 2009/02/12 09:31
I am using indexmenu in Monobook to generate a navigation menu. Everything works fine except when I enable userewrite: the tree is not displayed if no start page exist in the namespace. I tried to play with config parameters, flushed caches, etc. but without any success. Any idea?
Jean-Philippe Thierry 2009/04/17
What namespace? the tree root one? Please, try the development release and, if the bug persists, report (or send me via email) more details about your configuration (custom dokuwiki configuration, indexmenu syntax, acls or anything else that can be related to this issue) because i'm not able to reproduce it on my testing site. — Samuele Tognini 2009/04/17 15:52
I tried the development release. This time I can see all the levels except that the first one disappears when I click on it. I am using the last dokuwiki stable release without any specific tuning. The syntax of my navigation bar is{{indexmenu>..#1|navbar context}}Jean-Philippe Thierry 2009/04/17
With the “context” option, this behaviour could be normal. Check its meaning in the above syntax, this is not for displaying the full tree of your site, but the subtree of your current namespace (and if it has any children node, it'll be empty). For the full tree,{{indexmenu>..#1|navbar}}is sufficient (optionally you can add the 'js' javascript method). — Samuele Tognini 2009/04/22 21:03
It works with the development release. I should have read the manual more carefullyAnd thanks a lot for answering so quickly. Jean-Philippe Thierry 2009/04/17
Please, use the discussion page for feature requests and general discussion.