wiki:插件语法:indexmenu
差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
| wiki:插件语法:indexmenu [2026/10/13 22:10] – 外部编辑 127.0.0.1 | wiki:插件语法:indexmenu [2026/10/15 21:29] (当前版本) – 外部编辑 127.0.0.1 | ||
|---|---|---|---|
| 行 16: | 行 16: | ||
| downloadurl: | downloadurl: | ||
| donationurl: | donationurl: | ||
| - | ---- | + | --- |
| - | + | ^ :!: If you use the Indexmenu' | |
| - | ^ :!: If you use the Indexmenu' | + | |
| This plugin allows you to insert a fully customizable index or a list of pages starting from a specified namespace. | This plugin allows you to insert a fully customizable index or a list of pages starting from a specified namespace. | ||
| 行 34: | 行 33: | ||
| * Hide namespaces/ | * Hide namespaces/ | ||
| - | Themed indexmenu based on the Javascript index builder:\\ | + | Themed indexmenu based on the Javascript index builder:\ |
| - |  pages by title. | Useful when [useheading](config: |
| - | ^ '' | + | | `dsort` undo: `nodsort` | Sort (only) pages by date creation (first the oldest). | By default namespaces are **not** sorted, you need the **_nsort_** option for this. | |
| - | ^ '' | + | | `msort[# |
| - | ^ '' | + | | `hsort` undo: `nohsort` | Sort the headpages as defined by config setting [startpage](config: |
| - | ^ '' | + | | `rsort` undo: `norsort` | Reverse the sorting of pages (change between ascending and descending). | By default namespaces are **not** sorted, you need the **_nsort_** option for this. | |
| - | ^ '' | + | | `nsort` undo: `nonsort` | Also sort namespaces according to page sort options but grouped separately. | To use in _addition_ |
| - | ^ '' | + | | `nons` undo: `ns` | 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` |
| - | | Next options are _only_ available with _**js**_ option. ||| | + | | `skipfile[+\|=]/regexp/` | Skip files matching the regexp. | `skipfile**+**/ |
| - | ^ '' | + | | `skipns[+\|=]/regexp/` | Skip namespaces matching the regexp. | Just like skipfile, but [namespaces](# |
| - | ^ '' | + | | Next options are _only_ available with _**js**_ option. | | | |
| - | ^ '' | + | | `max#n`*`[#m]`* undo: `nomax` | 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 _**nocookie**_. | |
| - | ^ '' | + | | `maxjs#_n_` |
| - | ^ '' | + | | `id#[random\|ns\|_number_]` undo: `id#random` | [Cookie](https:// |
| - | ^ '' | + | | `nocookie` |
| - | ^ '' | + | | `noscroll` undo: `scroll` | Disable the JavaScript scrolling feature when it doesn' |
| + | | `notoc` | ||
| + | | `nomenu` | ||
| ## Examples | ## Examples | ||
| A sample of an indexmenu JS index 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' | A sample of an indexmenu JS index 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' | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| JS navigation index with " | JS navigation index with " | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| Standard DokuWiki index showing only pages inside wiki: | Standard DokuWiki index showing only pages inside wiki: | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu>: | {{indexmenu>: | ||
| - | </ | + | ``` |
| Js tree showing pages and namespaces both sorted by reverse title. For example,if " | Js tree showing pages and namespaces both sorted by reverse title. For example,if " | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu>: | {{indexmenu>: | ||
| - | </ | + | ``` |
| Standard index showing the tree of the current context ((the namespace of the page displayed by a user who is navigating your site)) opened at the second level . | Standard index showing the tree of the current context ((the namespace of the page displayed by a user who is navigating your site)) opened at the second level . | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| Show all current namespace pages . | Show all current namespace pages . | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| JS tree showing all (and only) the namespaces of the " | JS tree showing all (and only) the namespaces of the " | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| ### Metadata tag syntax | ### Metadata tag syntax | ||
| By default nodes on the same tree level are sorted by 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: | By default nodes on the same tree level are sorted by 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> | {{indexmenu_n> | ||
| - | </ | + | ``` |
| Where `N` is a number. | Where `N` is a number. | ||
| 行 160: | 行 183: | ||
| You can change the order of this tree containing a mix of standard and [useheading](config: | You can change the order of this tree containing a mix of standard and [useheading](config: | ||
| - | < | + | |
| + | ~~~ | ||
| -Root | -Root | ||
| |_don | |_don | ||
| 行 168: | 行 192: | ||
| |_van | |_van | ||
| |_vliet | |_vliet | ||
| - | </ | + | ~~~ |
| in this way: | in this way: | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| - | < | + | |
| + | |||
| + | ~~~ | ||
| -Root | -Root | ||
| |_vliet | |_vliet | ||
| 行 182: | 行 210: | ||
| |_pachuco | |_pachuco | ||
| |_At the radar station | |_At the radar station | ||
| - | </ | + | ~~~ |
| Pages without sort number, like the last three pages, are sorted by page name as default, but you can force a different sort: | Pages without sort number, like the last three pages, are sorted by page name as default, but you can force a different sort: | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| - | < | + | |
| + | |||
| + | ~~~ | ||
| -Root | -Root | ||
| |_vliet | |_vliet | ||
| 行 196: | 行 228: | ||
| |_Mirror sessions | |_Mirror sessions | ||
| |_pachuco | |_pachuco | ||
| - | </ | + | ~~~ |
| 行 235: | 行 268: | ||
| You can choose a name for the page from which retrieve the title or use a self defined value: | You can choose a name for the page from which retrieve the title or use a self defined value: | ||
| - | ^Value ^Page ^Example | + | |
| - | |**any value** | The page inside the namespace | public(ns): | + | | Value | Page | Example |
| - | |**: | + | | --- | --- | --- | |
| - | |**:same:** | a page with the same name of namespace, at the same level of the namespace | public(page) <=> public(ns) | | + | | **any value** | The page inside the namespace | public(ns): |
| - | |**: | + | | **: |
| + | | **:same:** | a page with the same name of namespace, at the same level of the namespace | public(page) <=> public(ns) | | ||
| + | | **:start:** | the global [start](config: | ||
| You can specify more than one option using "," | You can specify more than one option using "," | ||
| 行 251: | 行 286: | ||
| Set this option with a DokuWiki page ID (i.e: `tools: | Set this option with a DokuWiki page ID (i.e: `tools: | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| or | or | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| You may also want to hide this page in any indexmenu trees with the [skip files in index](.: | You may also want to hide this page in any indexmenu trees with the [skip files in index](.: | ||
| 行 264: | 行 303: | ||
| You can show a custom message in place of the menu tree if it can not be rendered (i.e namespace doesn' | You can show a custom message in place of the menu tree if it can not be rendered (i.e namespace doesn' | ||
| - | The alias **%%%%** is a shortcut for the requested namespace. | + | The alias **%%{{ns}}%%** is a shortcut for the requested namespace. |
| Message supports the wiki syntax, so it's fully customizable. Don't use HTML code. | Message supports the wiki syntax, so it's fully customizable. Don't use HTML code. | ||
| 行 272: | 行 311: | ||
| The configuration setting `skip_index` let you globally hide namespaces (and their pages) in your indexmenu trees. | The configuration setting `skip_index` let you globally hide namespaces (and their pages) in your indexmenu trees. | ||
| - | Just fill this option with the ids of namespaces to skip using [Regular Expression](http:// | + | Just fill this option with the ids of namespaces to skip using [Regular Expression](http:// |
| :!: Till V4.5, a namespaces full path has to be declared as a file system path (i.e.: " | :!: Till V4.5, a namespaces full path has to be declared as a file system path (i.e.: " | ||
| There are also some issues [About empty namespaces](.: | There are also some issues [About empty namespaces](.: | ||
| - | **Simple examples:**\\ | + | **Simple examples: |
| Skip any namespace whose ID contains the word `copyright` or `privatens: | Skip any namespace whose ID contains the word `copyright` or `privatens: | ||
| - | < | + | |
| + | ``` | ||
| / | / | ||
| - | </ | + | ``` |
| Skip the namespace whose ID is exactly `myusers: | Skip the namespace whose ID is exactly `myusers: | ||
| - | < | + | |
| + | ``` | ||
| / | / | ||
| - | </ | + | ``` |
| ### Skip Files in index | ### Skip Files in index | ||
| This configuration option `skip_file` let you to globally hide one or more pages in your indexmenu trees. | This configuration option `skip_file` let you to globally hide one or more pages in your indexmenu trees. | ||
| - | Just fill this option with the ids of pages to skip using [Regular Expression](http:// | + | Just fill this option with the ids of pages to skip using [Regular Expression](http:// |
| :!: Till v4.5, 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.: " | :!: Till v4.5, 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.: " | ||
| 行 378: | 行 421: | ||
| Simply create a subdirectory, | Simply create a subdirectory, | ||
| - | ^ Icon ^ Type | + | |
| - | | base.gif | + | | Icon | Type | Example: theme ' |
| - | | folderopen.gif | + | | --- | --- | --- | |
| - | | folder.gif | + | | base.gif | Root Folder |  |  | ; | ); | ||
| - | </ | + | ``` |
| * Removing menu entry: | * Removing menu entry: | ||
| * Override with empty array: `[]` | * Override with empty array: `[]` | ||
| 行 433: | 行 482: | ||
| * `entryDescriptionArray` - array with description of a menu entry | * `entryDescriptionArray` - array with description of a menu entry | ||
| - | **How to write utf8 chars, like èåäö, in the context menu file?**\\ | + | **How to write utf8 chars, like èåäö, in the context menu file?**\ |
| A solution is to encode them yourself: Find your char at http:// | A solution is to encode them yourself: Find your char at http:// | ||
| - | ------ | + | --- |
| In the releases _before April_ 2013, you could fully customize those menus by editing these files in the ' | In the releases _before April_ 2013, you could fully customize those menus by editing these files in the ' | ||
| - | ^File ^Loaded by^ | + | |
| - | |" | + | | File | Loaded by | |
| - | |" | + | | --- | --- | |
| - | |" | + | | " |
| + | | " | ||
| + | | " | ||
| And to prevent to load the context menu, simply remove the indexmenu_contextmenu variable declared in the above menu files. | And to prevent to load the context menu, simply remove the indexmenu_contextmenu variable declared in the above menu files. | ||
| 行 452: | 行 503: | ||
| Some styles are: | Some styles are: | ||
| - | ^Tag ^Comment | + | |
| - | |a.nodeFdUrl | + | | Tag | Comment |
| - | |a.node | + | | --- | --- | --- | |
| - | |a.nodeUrl | + | | a.nodeFdUrl | Namespace with URL link (headpage) | js | |
| - | |a.nodeSel | + | | a.node | Namespace without URL link | js | |
| - | |a.navSel | + | | a.nodeUrl | Page | js | |
| - | |a.indexmenu_idx_head |link style of a namespace with URL (headpage) | + | | a.nodeSel | Previous selected page or headpage highlight | js | |
| - | |a.indexmenu_idx | + | | a.navSel | Current page highlight | js | |
| - | |.indexmenu_arrow | + | | a.indexmenu_idx_head | link style of a namespace with URL (headpage) | nojs | |
| - | |.indexmenu_toc | + | | 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 | | ||
| 行 469: | 行 522: | ||
| FIXME check if this example is still up-to-date. For example you could add for the ' | FIXME check if this example is still up-to-date. For example you could add for the ' | ||
| - | < | + | |
| + | ```css lib/ | ||
| /*Custom style for the thread theme*/ | /*Custom style for the thread theme*/ | ||
| 行 480: | 行 534: | ||
| color: #fff | color: #fff | ||
| } | } | ||
| - | </ | + | ``` |
| Existing example for ' | Existing example for ' | ||
| 行 489: | 行 544: | ||
| # FAQ and Notes | # FAQ and Notes | ||
| ### The tree is not working as expected | ### The tree is not working as expected | ||
| - | * If you installed for the first time the indexmenu plugin or upgraded it from a previous release, it could be merely a cache issue. Example of symptoms are: tree is not displayed (or a static DokuWiki index is displayed in its place), context menu is not working, any new release feature reported in the [changelog](.indexmenu# | + | * If you installed for the first time the indexmenu plugin or upgraded it from a previous release, it could be merely a cache issue. Example of symptoms are: tree is not displayed (or a static DokuWiki index is displayed in its place), context menu is not working, any new release feature reported in the [changelog](.indexmenu# |
| - | * When an updated indexmenu plugin fails in a _2013-05-10 " | + | Try to follow instructions to purge cache described in the [The tree is not displayed](.indexmenu# |
| + | * When an updated indexmenu plugin fails in a _2013-05-10 " | ||
| + | Please check whether all plugins and your theme don't use the old javascript functions. Since the Weatherwax release, these deprecated functions are missing (some plugins still require an update) and will break the javascript rendering.\ | ||
| + | Check for errors:\ | ||
| + | - in console of browser e.g. as part of the Developer toolbar\ | ||
| + | - by disabling all plugins and enabling one by one | ||
| * If you think that indexmenu are still not fitting your needs, be sure to using a correct [syntax](.indexmenu# | * If you think that indexmenu are still not fitting your needs, be sure to using a correct [syntax](.indexmenu# | ||
| * You are sure that the syntax is correct. Perhaps you missed something in this [FAQ and Notes](.indexmenu# | * You are sure that the syntax is correct. Perhaps you missed something in this [FAQ and Notes](.indexmenu# | ||
| 行 520: | 行 580: | ||
| ### Indexmenu ID conflict | ### Indexmenu ID conflict | ||
| I have in my sidebar the following code | I have in my sidebar the following code | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| and I get after saving this message: `Indexmenu ID conflict`. What's wrong? | and I get after saving this message: `Indexmenu ID conflict`. What's wrong? | ||
| 行 575: | 行 637: | ||
| * **Disabled**: | * **Disabled**: | ||
| - | In both cases, unauthorized pages are never showed. There are also some issues [About empty namespaces](.: | + | In both cases, unauthorized pages are never showed. There are also some issues [About empty namespaces](.: |
| This namespace behaviour in presence of ACLs can not be changed until it's not changed in the DokuWiki core itself. | This namespace behaviour in presence of ACLs can not be changed until it's not changed in the DokuWiki core itself. | ||
| Example: | Example: | ||
| - | < | + | |
| + | ``` | ||
| +-Mysite | +-Mysite | ||
| | | ||
| 行 592: | 行 655: | ||
| | | ||
| | | ||
| - | </ | + | ``` |
| **Enabled** will display: | **Enabled** will display: | ||
| - | < | + | |
| + | ``` | ||
| +-Mysite | +-Mysite | ||
| | | ||
| 行 602: | 行 667: | ||
| | | ||
| | | ||
| - | </ | + | ``` |
| **Disabled** will display: | **Disabled** will display: | ||
| - | < | + | |
| + | ``` | ||
| +-Mysite | +-Mysite | ||
| | | ||
| 行 615: | 行 682: | ||
| | | ||
| | | ||
| - | </ | + | ``` |
| 行 628: | 行 696: | ||
| When the `max#nr` option or level of folded nodes are configured and the node has to retrieve its children through the Ajax request, there can appear empty nodes because indexmenu hasn't looked forward and doesn' | When the `max#nr` option or level of folded nodes are configured and the node has to retrieve its children through the Ajax request, there can appear empty nodes because indexmenu hasn't looked forward and doesn' | ||
| - | **Why do you need a sort option to correctly hide empty namespaces? | + | **Why do you need a sort option to correctly hide empty namespaces? |
| When any of the sort options `tsort`, `dsort`, `msort` `nsort` or `hsort` is used indexmenu replaces the faster, but less featured, core DokuWiki search with the slower, but more featured, indexmenu search that filters more empty nodes. | When any of the sort options `tsort`, `dsort`, `msort` `nsort` or `hsort` is used indexmenu replaces the faster, but less featured, core DokuWiki search with the slower, but more featured, indexmenu search that filters more empty nodes. | ||
| - | **Why will sneaky_index hide forbidden namespaces**\\ | + | **Why will sneaky_index hide forbidden namespaces**\ |
| Enabling the `[sneaky_index](config: | Enabling the `[sneaky_index](config: | ||
| 行 648: | 行 716: | ||
| # Discussion | # Discussion | ||
| - | Please, use the [discussion](.: | + | Please, use the [discussion](.: |
| + | Old discussions are archived in the [olddiscussion](.: | ||
wiki/插件语法/indexmenu.1791900622.txt.gz · 最后更改: 由 127.0.0.1
