:!: All the syntax options can be easily accessed with the indexmenu picker in the edit window toolbar.
Main Options
{{indexmenu>ns[#n] [ns1[#n] ns2[#n] …] | [js[#theme]] [tsort] … }}

Arguments inside ”[]” parenthesis are optional. The ”#” char is always required with related options.

Main Action Note
ns Main namespace name. Index starts from it. Syntax complies with DokuWiki namespaces paths..” refers to the namespace of the page containing the indexmenu syntax and not to the current DokuWiki namespace context 1) (see the context option for this feature). “..” or an empty value shows the root site namespace.
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. If it's not defined then all namespaces are open, if 0 or 1 they are closed. Optional.
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. Syntax complies with DokuWiki namespaces. If n is not defined then all namespaces are open, if 0 they are closed. “.” refers to the namespace of the page containing the indexmenu syntax and not to the current DokuWiki namespace context 2) (see the context option for this feature). “..” or an empty value shows the root site namespace. Optional.

Optional settings after the “|” separator:

Option Action Note
js JavaScript render method: the index is an expandable tree menu. 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 the default DokuWiki index page) and the DokuWiki loading could be slower depending on the amount of child nodes displayed.
context Relative main namespace and optional namespaces will refer to the current DokuWiki namespace context 3) instead of to the namespace of the page containing the indexmenu syntax. 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 (In js mode, when a lot of nodes are usually displayed, the max option is recommended). It automatically enable the nocookie option.
tsort Sort (only) pages by title. Useful when useheading is on. By default namespaces are not sorted, you need the nsort option for this.
dsort Sort (only) pages by date creation. By default namespaces are not sorted, you need the nsort option for this.
msort[#meta] Sort (only) pages by a custom devel:metadata information. Without the meta parameter, it looks for the custom sorting number specified with the {{indexmenu_n>N}} syntax (see the below metadata tag syntax). meta should refer to the devel:metadata#data structure (Array values are managed through the ”:” separator, for example: “msort#date:modified). By default, pages without metadata tag are sorted by page name (the default DokuWiki way), but you can override this behaviour adding also the tsort or dsort option in the indexmenu syntax. By default namespaces are not sorted, you need the nsort option for this.
rsort Reverse the sorting of pages. By default namespaces are not sorted, you need the nsort option for this.
nsort Sort also namespaces according to the previous sort options.
nons Exclude namespaces nodes from index. It shows only the pages. Without js, the closing n namespace option prevents to display nodes below the n namespace level.
nopg Exclude pages nodes from index. It shows only the namespaces.
max#n[#m] If initially closed, the node at n level will retrieve all its child nodes through the AJAX mechanism when opened for the first time. Optionally, the nodes after the n level can be retrieved with AJAX every m sublevels instead of in one go. It affects the server loading and speeds up the loading of pages in DokuWiki with an high amount of pages. It works only in js. Cookie are automatically disabled, just like with noocookie.
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 where the previously opened/closed nodes by a user are stored. Useful when a page is uncached and you don't use the nocookie option because it forces the same cookie preventing un-useful cookies created every time a page is viewed by the user. By default is always random even when this option is not specified, but you can force it to be a n fixed number ( i.e id#20 ). 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 Disable cookies. 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

See indexmenu for more information.

1) , 2) , 3) the namespace of the page displayed by a user who is navigating your site
 
wiki/snippets/indexmenu.txt · Last modified: 2010/01/13 14:00 by Olivier Mehani
Recent changes · Show pagesource · Login