wiki:插件语法:indexmenu
差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 后一修订版 | 前一修订版 | ||
| wiki:插件语法:indexmenu [2022/10/19 09:08] – 创建 zhangguo | wiki:插件语法:indexmenu [2026/10/15 21:29] (当前版本) – 外部编辑 127.0.0.1 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== | + | # IndexMenu Plugin |
| ---- plugin ---- | ---- plugin ---- | ||
| description: | description: | ||
| 行 17: | 行 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. | ||
| - | It should be useful in DokuWiki sites where pages are organized by [[:namespaces]]. | + | It should be useful in DokuWiki sites where pages are organized by [namespaces](namespaces). |
| Main features are: | Main features are: | ||
| - | * Fully customizable with a lot of [[.: | + | * Fully customizable with a lot of [flexible options](.: |
| * Built-in support of Navigation features like highlighting the current location or dynamically displaying the tree of the current namespace. | * Built-in support of Navigation features like highlighting the current location or dynamically displaying the tree of the current namespace. | ||
| - | * Easily themeable with prebuilt [[.: | + | * Easily themeable with prebuilt [JavaScript themes](.: |
| - | * Assign [[.: | + | * Assign [Namespaces title and link (headpages)](.: |
| * Sortable by date, title and custom metadata information. | * Sortable by date, title and custom metadata information. | ||
| * AJAX support to speed up sites with many pages. | * AJAX support to speed up sites with many pages. | ||
| - | * Customizable [[.: | + | * Customizable [context mouse menu](.: |
| * TOC pages preview. | * TOC pages preview. | ||
| - | * [[.: | + | * [Replace](.: |
| - | * Hide namespaces/ | + | * Hide namespaces/ |
| - | Themed indexmenu based on the Javascript index builder:\\ | + | Themed indexmenu based on the Javascript index builder:\ |
| - | {{http:// | + |  [toolbar](toolbar). | ||
| - | ===== Full syntax ===== | ||
| + | ## Full syntax | ||
| Settings **before the " | Settings **before the " | ||
| - | ^Main ^Action | + | |
| - | ^ //'' | + | | Main | Action |
| - | ^ //'' | + | | --- | --- | --- | |
| - | ^ //'' | + | | _`ns`_ | _**Main namespace**_ name. Index starts from here. Syntax complies with DokuWiki [namespaces](namespaces# |
| + | | _`#n`_ | **n** is a number that specifies how many namespace levels to display open under the _**main namespace**_. | If it's not defined then the whole tree, till the deeper node, will be open. If `_0_` or `_1_` it'll display only nodes under the main namespace. For example: "# | ||
| + | | _`ns1[#n] %%...%% nsn[#n]`_ | A list _**of optional namespaces**_ inside the _**main namespace**_. Every namespace will be opened or closed at the specified | ||
| Optional settings **after the " | Optional settings **after the " | ||
| - | ^Option ^Action ^Note| | ||
| - | ^ '' | ||
| - | ^ //''# | ||
| - | | Next options are available with or without //**js**// option. ||| | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | | Next options are //only// available with //**js**// option. ||| | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| - | ^ '' | ||
| + | | Option | Action | Note | | ||
| + | | --- | --- | --- | | ||
| + | | `js` undo: `nojs` | JavaScript render method: the index is an expandable tree menu. Without the `js` option DokuWikis index renderer is used | Without _**n**_, all nodes are open, with it, nodes are open till _**n**_ level. | | ||
| + | | _`# | ||
| + | | Next options are available with or without _**js**_ option. | | | | ||
| + | | `navbar` | ||
| + | | `context` | ||
| + | | `tsort` | ||
| + | | `dsort` | ||
| + | | `msort[# | ||
| + | | `hsort` | ||
| + | | `rsort` | ||
| + | | `nsort` | ||
| + | | `nons` | ||
| + | | `nopg` | ||
| + | | `skipfile[+\|=]/ | ||
| + | | `skipns[+\|=]/ | ||
| + | | Next options are _only_ available with _**js**_ option. | | | | ||
| + | | `max# | ||
| + | | `maxjs# | ||
| + | | `id# | ||
| + | | `nocookie` | ||
| + | | `noscroll` | ||
| + | | `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 '' | + | Where `N` is a number. |
| Then you need to use the " | Then you need to use the " | ||
| - | If you have the '' | + | If you have the `show_sort` option enabled in the Configuration Manager, a notice is displayed to admins (only) on every page with this metadata tag (the text defaults to " |
| **Examples: | **Examples: | ||
| - | You can change the order of this tree containing a mix of standard and [[config: | + | You can change the order of this tree containing a mix of standard and [useheading](config: |
| - | < | + | |
| + | ~~~ | ||
| -Root | -Root | ||
| |_don | |_don | ||
| 行 174: | 行 192: | ||
| |_van | |_van | ||
| |_vliet | |_vliet | ||
| - | </ | + | ~~~ |
| in this way: | in this way: | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| - | < | + | |
| + | |||
| + | ~~~ | ||
| -Root | -Root | ||
| |_vliet | |_vliet | ||
| 行 188: | 行 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 | ||
| 行 202: | 行 228: | ||
| |_Mirror sessions | |_Mirror sessions | ||
| |_pachuco | |_pachuco | ||
| - | </ | + | ~~~ |
| - | ====== Configuration options====== | ||
| - | Indexmenu is fully configurable from [[plugin: | + | # Configuration options |
| + | Indexmenu is fully configurable from [Configuration Manager](plugin: | ||
| - | ==== Default options===== | + | ### Default options |
| - | Default options let you define settings that are applied to all the indexmenu indexes included in pages. To undo any syntax option, use the inverse version of the option. Normally that option is the same but with or without | + | Default options let you define settings that are applied to all the indexmenu indexes included in pages. To undo any syntax option, use the inverse version of the option. Normally that option is the same but with or without |
| - | + | ||
| - | ==== Only admins ==== | + | |
| + | ### Only admins | ||
| It prevents no-admin users from inserting indexmenu trees, removing every indexmenu syntax in the page. It affects only the edit mode, so that standard users are still able to view indexmenu tree in a page edited by admins. | It prevents no-admin users from inserting indexmenu trees, removing every indexmenu syntax in the page. It affects only the edit mode, so that standard users are still able to view indexmenu tree in a page edited by admins. | ||
| 行 219: | 行 244: | ||
| - | ==== ACL Cache ==== | + | ### ACL Cache |
| Optimize the cache of indexmenu according to ACLs and prevents to display unauthorized nodes. | Optimize the cache of indexmenu according to ACLs and prevents to display unauthorized nodes. | ||
| 行 230: | 行 254: | ||
| If wrongly set, this option could display to a group of users (ie. the anonymous user) the cached tree of another group (ie: the admin user), thus displaying randomly different trees containing less or more (un)authorized nodes. | If wrongly set, this option could display to a group of users (ie. the anonymous user) the cached tree of another group (ie: the admin user), thus displaying randomly different trees containing less or more (un)authorized nodes. | ||
| - | There are also important issues in [[.: | + | There are also important issues in [about ACLs](.: |
| - | ==== Namespaces title and link (headpages) | + | ### Namespaces title and link (headpages) |
| + | ##### Titles for page headings | ||
| + | First of all, if you want that the whole tree displays the heading title of pages instead of their name, you need to set the config setting [useheading](config: | ||
| - | == Titles for page headings == | + | ##### Title for namespaces headings |
| - | + | Next, if you want that the namespace nodes display a heading title instead of the namespace name, you need to select the page from which these are retrieved with the config option | |
| - | First of all, if you want that the whole tree displays the heading title of pages instead of their name, you need to set the config setting [[config: | + | |
| - | + | ||
| - | == Title for namespaces headings | + | |
| - | + | ||
| - | Next, if you want that the namespace nodes display a heading title instead of the namespace name, you need to select the page from which these are retrieved with the config option | + | |
| Every namespace will retrieve its title from the heading title of that page, called headpage, and will be linked directly to it. No longer you can open the node by clicking the header (in the js version you can still use the plus before namespace). | Every namespace will retrieve its title from the heading title of that page, called headpage, and will be linked directly to it. No longer you can open the node by clicking the header (in the js version you can still use the plus before namespace). | ||
| 行 247: | 行 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 | ||
| - | |**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) | | ||
| - | |**: | ||
| - | You can specify more than one option using "," as separator. For every namespace, | + | | Value | Page | Example | |
| + | | --- | --- | --- | | ||
| + | | **any value** | The page inside the namespace | public(ns): | ||
| + | | **: | ||
| + | | **:same:** | a page with the same name of namespace, | ||
| + | | **:start:** | the global [start](config: | ||
| - | == Hide headpages in tree == | + | You can specify more than one option using "," |
| - | To get a better visualization you could use the '' | + | ##### Hide headpages in tree |
| + | To get a better visualization you could use the `hide_headpage` option, that hides headpages, such as defined by config | ||
| - | ==== Page index ==== | + | ### Page index |
| + | When this option is not empty, the DokuWiki default [index](index) page is replaced with a custom page, which you can fill yourself. For example you can add the indexmenu tree of your site. | ||
| - | When this option | + | Set this option with a DokuWiki |
| - | Set this option with a DokuWiki page ID (i.e: '' | + | ``` |
| - | < | + | |
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| or | or | ||
| - | < | + | |
| + | ``` | ||
| {{indexmenu> | {{indexmenu> | ||
| - | </ | + | ``` |
| - | You may also want to hide this page in any indexmenu trees with the [[.: | + | |
| + | You may also want to hide this page in any indexmenu trees with the [skip files in index](.: | ||
| - | ==== Empty message ==== | ||
| + | ### Empty message | ||
| 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' | ||
| 行 284: | 行 308: | ||
| - | ==== Skip Namespaces in Index ==== | + | ### Skip Namespaces in Index |
| + | The configuration setting `skip_index` let you globally hide namespaces (and their pages) in your indexmenu trees. | ||
| - | The configuration setting '' | + | 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 [[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 [[.: | + | There are also some issues [About empty namespaces](.: |
| - | **Simple examples:**\\ | + | **Simple examples: |
| - | Skip any namespace whose ID contains the word '' | + | Skip any namespace whose ID contains the word `copyright` or `privatens: |
| - | < | + | |
| + | ``` | ||
| / | / | ||
| - | </ | + | ``` |
| - | Skip the namespace whose ID is exactly | + | |
| - | < | + | Skip the namespace whose ID is exactly |
| + | |||
| + | ``` | ||
| / | / | ||
| - | </ | + | ``` |
| - | ==== Skip Files in index==== | ||
| - | This configuration option | + | ### Skip Files in index |
| - | Just fill this option with the ids of pages to skip using [[http:// | + | This configuration option |
| + | 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.: " | ||
| - | There are also some issues [[.: | + | There are also some issues [About empty namespaces](.: |
| - | ==== Show sort ==== | + | ### Show sort |
| - | + | If you sorted a page with the [metadata tag syntax](.: | |
| - | If you sorted a page with the [[.: | + | |
| The message is displayed **only** to wiki admins when they view the page. | The message is displayed **only** to wiki admins when they view the page. | ||
| - | ====== | + | # How to install |
| - | + | Search and install the plugin using the [Extension Manager](plugin: | |
| - | Search and install the plugin using the [[plugin: | + | |
| Alternative download link: http:// | Alternative download link: http:// | ||
| - | [[http:// | + | [Old releases](http:// |
| - | ===== Changelog ===== | + | ## Changelog |
| + | |:!: You could need to purge your browser and server cache after upgrading it, following these [instructions](.: | ||
| - | |:!: You could need to purge your browser and server cache after upgrading it, following these [[.: | + | ^Many thanks |
| - | ^Many thanks to [[user> | ||
| - | |||
| - | |||
| - | ==== Github changelog ==== | ||
| + | ### Github changelog | ||
| {{rss> | {{rss> | ||
| - | ==== Release changelog | + | ### Release changelog |
| * **2014-08-01** | * **2014-08-01** | ||
| * Default options can be configured in Config Manager for whole wiki | * Default options can be configured in Config Manager for whole wiki | ||
| 行 351: | 行 372: | ||
| * **2013-04-24 Version 5.0**: | * **2013-04-24 Version 5.0**: | ||
| * Reformat of all code to Dokuwiki code style | * Reformat of all code to Dokuwiki code style | ||
| - | * Rewrite all javascript to jQuery instead of old js api (includes improvements from [[tindexmenu]] plugin) | + | * Rewrite all javascript to jQuery instead of old js api (includes improvements from [tindexmenu](tindexmenu) |
| * Added a new toolbar wizard | * Added a new toolbar wizard | ||
| * Used Dokuwikis javascript include mechanism | * Used Dokuwikis javascript include mechanism | ||
| - | * add '' | + | * add `hsort` for sorting [startpage](config: |
| * Rewrite the ajax stuff into action plugin (not theme handling stuff) | * Rewrite the ajax stuff into action plugin (not theme handling stuff) | ||
| * Change configuration via menu js files to one file. | * Change configuration via menu js files to one file. | ||
| - | * add option | + | * add option |
| - | * Improved support for [[config: | + | * Improved support for [useheading](config: |
| - | * Added syntax option to add '' | + | * Added syntax option to add `skipfile+/ |
| * Adding curid span like DokuWiki performs on internal links. | * Adding curid span like DokuWiki performs on internal links. | ||
| * Fixed: When only had indexmenu syntax in sidebar, in js rendered index the backup index wasn't hidden. | * Fixed: When only had indexmenu syntax in sidebar, in js rendered index the backup index wasn't hidden. | ||
| - | * Fixed: Ajax completion supports Korean characters too. - by [[user> | + | * Fixed: Ajax completion supports Korean characters too. - by [user> |
| * **2009-08-29 Version 4.6**: | * **2009-08-29 Version 4.6**: | ||
| - | * :!: //New Feature//: Namespace declaration complies with DokuWiki [[:namespaces# | + | * :!: _New Feature_: Namespace declaration complies with DokuWiki [namespaces](namespaces# |
| - | * //New Feature//: Added the // | + | * _New Feature_: Added the _context_ |
| - | * :!: //New Feature//: Changed skip_file and skip_index syntax to use DokuWiki ID instead of system paths. Thanks to Dmitry Katsubo. | + | * :!: _New Feature_: Changed skip_file and skip_index syntax to use DokuWiki ID instead of system paths. Thanks to Dmitry Katsubo. |
| - | * //New Feature//: Metatada titles are not rendered when recursively building the indexmenu tree. This will speed up the page loading when cache expires, but could not display the heading title for nodes without metadata information. | + | * _New Feature_: Metatada titles are not rendered when recursively building the indexmenu tree. This will speed up the page loading when cache expires, but could not display the heading title for nodes without metadata information. |
| - | * //New Feature//: Added the nojs button in the edit toolbar and toolbar CSS classes. | + | * _New Feature_: Added the nojs button in the edit toolbar and toolbar CSS classes. |
| - | * //New Feature//: The right JS context menu is closed by any document click. Thanks to Urban. | + | * _New Feature_: The right JS context menu is closed by any document click. Thanks to Urban. |
| - | * //Bug//: Fixed a bug which prevents page caching when it contains only indexmenu syntax. | + | * _Bug_: Fixed a bug which prevents page caching when it contains only indexmenu syntax. |
| - | * //Bug//: Disable JS indexmenu cookies in preview mode. | + | * _Bug_: Disable JS indexmenu cookies in preview mode. |
| - | * //Bug//: Fixed an ACL issue. | + | * _Bug_: Fixed an ACL issue. |
| - | * //Bug//: Fixed UTF8 TOC preview bug. | + | * _Bug_: Fixed UTF8 TOC preview bug. |
| - | ===== Development | + | ## Development |
| For development separated branches of the code are created to test features and bug fixes. See the list of current branches: https:// | For development separated branches of the code are created to test features and bug fixes. See the list of current branches: https:// | ||
| - | Before installing a development version be sure to have first manually deleted the old indexmenu directory. Also be sure that, as last step, server/ | + | Before installing a development version be sure to have first manually deleted the old indexmenu directory. Also be sure that, as last step, server/ |
| - | + | ||
| - | ===== Translations ===== | + | |
| + | ## Translations | ||
| At this moment some languages are supported , but I'll be glad if you want translate indexmenu in your own language. Please refer to translation tool at http:// | At this moment some languages are supported , but I'll be glad if you want translate indexmenu in your own language. Please refer to translation tool at http:// | ||
| - | ====== | + | # JavaScript themes |
| - | + | With the option | |
| - | With the option | + | When the `js` option is used without |
| - | When the '' | + | |
| Inside the Admin panel on the Indexmenu Utilities page you can manage the available themes on your installation and install themes from the public indexmenu repository. To download themes directly into your DokuWiki server, you need that the indexmenu images directory is writable by the web user. | Inside the Admin panel on the Indexmenu Utilities page you can manage the available themes on your installation and install themes from the public indexmenu repository. To download themes directly into your DokuWiki server, you need that the indexmenu images directory is writable by the web user. | ||
| - | Instead of installing you can also simply download a theme into your PC with the '' | + | Instead of installing you can also simply download a theme into your PC with the `download` link, and then manually install it. |
| - | The JavaScript tree menu is based on [[http:// | + | The JavaScript tree menu is based on [dTree](http:// |
| - | ==== Theme tutorial | + | ### Theme tutorial |
| + | You can create custom themes for every index rendered with the [dTree](http:// | ||
| - | You can create | + | Simply |
| - | Simply create a subdirectory, | + | | Icon | Type | Example: theme ' |
| - | ^ Icon ^ Type | + | | --- | --- | --- | |
| - | | base.gif | + | | base.gif | Root Folder |  |  | . On Opera you can use the CTRL+left click to display it. When in editing mode, by default an " | 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 " | ||
| - | In the April 2013 release of the plugin the contextmenu definition is bundled in '' | + | In the April 2013 release of the plugin the contextmenu definition is bundled in `scripts/ |
| - | Be aware this file is overwritten on update of the plugin. Therefore an additional file '' | + | Be aware this file is overwritten on update of the plugin. Therefore an additional file `scripts/ |
| - | Since the April 2013 plugin release you can add the **'' | + | Since the April 2013 plugin release you can add the **`nomenu`** option to indexmenu syntax to disable the contextmenu. |
| - | Modification of menu in performed in '' | + | Modification of menu in performed in `scripts/ |
| - | (You can rename the example file from '' | + | (You can rename the example file from `scripts/ |
| - | * Overriding menu entry \\ < | + | * Overriding menu entry\ |
| + | ```javascript | ||
| indexmenu_contextmenu[' | indexmenu_contextmenu[' | ||
| - | </ | + | ``` |
| - | * Adding menu entry \\ < | + | |
| + | * Adding menu entry\ | ||
| + | ```javascript | ||
| indexmenu_contextmenu[' | indexmenu_contextmenu[' | ||
| 3, | 3, | ||
| 行 450: | 行 471: | ||
| [' | [' | ||
| ); | ); | ||
| - | </ | + | ``` |
| * Removing menu entry: | * Removing menu entry: | ||
| - | * Override with empty array: | + | * Override with empty array: |
| - | * Or use '' | + | * Or use `.splice(entryIndexNo, |
| - | Some details about '' | + | Some details about `Array.splice(entryIndexNo, |
| - | * '' | + | * `entryIndexNo` - position of entry, start counting at zero |
| - | * '' | + | * `howManyToRemove` - number of entries to be removed. Set to zero to only add entries. |
| - | * '' | + | * `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 | + | In the releases |
| - | ^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. | ||
| - | ====== | + | # CSS Style |
| - | + | You can override styling from the [style.css](https:// | |
| - | You can override styling from the [[https:// | + | |
| Some styles are: | Some styles are: | ||
| - | ^Tag ^Comment | ||
| - | |a.nodeFdUrl | ||
| - | |a.node | ||
| - | |a.nodeUrl | ||
| - | |a.nodeSel | ||
| - | |a.navSel | ||
| - | |a.indexmenu_idx_head |link style of a namespace with URL (headpage) | ||
| - | |a.indexmenu_idx | ||
| - | |.indexmenu_arrow | ||
| - | |.indexmenu_toc | ||
| + | | Tag | Comment | Mode | | ||
| + | | --- | --- | --- | | ||
| + | | a.nodeFdUrl | Namespace with URL link (headpage) | js | | ||
| + | | a.node | Namespace without URL link | js | | ||
| + | | a.nodeUrl | Page | js | | ||
| + | | a.nodeSel | Previous 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 | | ||
| - | ===== Custom theme CSS style ===== | ||
| - | If you want to apply a different style then the global one to a js theme, you need to create a '' | + | ## Custom theme CSS style |
| + | If you want to apply a different style then 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. | ||
| 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*/ | ||
| 行 509: | 行 534: | ||
| color: #fff | color: #fff | ||
| } | } | ||
| - | </ | + | ``` |
| - | Existing example for ' | ||
| - | Note: in about June 2014 the css of some ''.dtree'' related stylesheet lines is changed. This can break your styling. Please use the latest version of indexmenu, and review your styles. A look at the [[https:// | + | Existing example for 'human.png' |
| + | Note: in about June 2014 the css of some `.dtree` related stylesheet lines is changed. This can break your styling. Please use the latest version of indexmenu, and review your styles. A look at the [CSS changeset](https:// | ||
| - | ====== FAQ and Notes ====== | ||
| - | ==== | + | # FAQ and Notes |
| + | ### 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# | ||
| + | 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 " | ||
| + | | ||
| + | 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# | ||
| + | * You are sure that the syntax is correct. Perhaps you missed something in this [FAQ and Notes](.indexmenu# | ||
| + | * Still no solution? Check if someone reported your issue at the [Issue tracker](https:// | ||
| + | * Okay, now I believe that indexmenu is really not working as needed. Please report a detailed bug at the [Issue tracker](https:// | ||
| - | * 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 [[.indexmenu# | ||
| - | * When an updated indexmenu plugin fails in a // | ||
| - | * If you think that indexmenu are still not fitting your needs, be sure to using a correct [[.indexmenu# | ||
| - | * You are sure that the syntax is correct. Perhaps you missed something in this [[.indexmenu# | ||
| - | * Still no solution? Check if someone reported your issue at the [[https:// | ||
| - | * Okay, now I believe that indexmenu is really not working as needed. Please report a detailed bug at the [[https:// | ||
| - | |||
| - | |||
| - | ==== The tree is not displayed ==== | ||
| + | ### The tree is not displayed | ||
| Follows these instructions: | Follows these instructions: | ||
| - | - To have installed an indexmenu release compatible with your DokuWiki version as described in [[indexmenu# | + | - To have installed an indexmenu release compatible with your DokuWiki version as described in [how to install](indexmenu# |
| - | - To have the last indexmenu version installed. For example check that its date is the same of [[.: | + | - To have the last indexmenu version installed. For example check that its date is the same of [changelog](.: |
| - | - To have used a correct [[.: | + | - To have used a correct [syntax](.: |
| - | - To have purged your browser cache. Use '' | + | - To have purged your browser cache. Use `Ctrl + R` or `Ctrl + F5` |
| - | - To have purged server cache following the [[:caching# | + | - To have purged server cache following the [purging_the_cache](caching# |
| - To have purged CSS and JavaScript as cached by DokuWiki. Go to the Configuration Manager and just resave, to refresh this caching. | - To have purged CSS and JavaScript as cached by DokuWiki. Go to the Configuration Manager and just resave, to refresh this caching. | ||
| - When you try the javascript version of the indexmenu and it fails, please disable all the self-installed plugins check if now works. Nextly, you enable the plugins one-by-one to find the bad one. | - When you try the javascript version of the indexmenu and it fails, please disable all the self-installed plugins check if now works. Nextly, you enable the plugins one-by-one to find the bad one. | ||
| - | If problem still persists, please, report the bug with details of your configuration in [[.: | + | If problem still persists, please, report the bug with details of your configuration in [reporting_feature_requests_and_bugs](.: |
| - | + | ||
| - | ==== I see nothing in sidebar when I login like user ==== | + | |
| + | ### I see nothing in sidebar when I login like user | ||
| Check your ACL settings, please note that the user needs at least READ permissions to the page " | Check your ACL settings, please note that the user needs at least READ permissions to the page " | ||
| - | ==== DokuWiki is getting slow ==== | + | ### DokuWiki is getting slow |
| 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. | 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 rebuilt. | This happens when cache is purged and the whole indexmenu tree has to be rebuilt. | ||
| - | To avoid this problem you may use the [[plugin: | + | To avoid this problem you may use the [max](plugin: |
| - | ==== 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: | + | |
| + | and I get after saving this message: | ||
| 行 568: | 行 595: | ||
| > When you have a sidebar defined a sidebar, but it is used as normal page too e.g. an index page, it is recommended to create a separate page for the index page. A separate page prevents displaying same index twice so they can not conflict anymore. The index page may have the same syntax options as the sidebar, but when you use id with a self defined id# | > When you have a sidebar defined a sidebar, but it is used as normal page too e.g. an index page, it is recommended to create a separate page for the index page. A separate page prevents displaying same index twice so they can not conflict anymore. The index page may have the same syntax options as the sidebar, but when you use id with a self defined id# | ||
| - | >> A workaround to get rid of the warning message, is to use the [[:plugin: | + | >> A workaround to get rid of the warning message, is to use the [Nosidebar plugin](plugin: |
| - | ==== Can I sort the tree nodes (filename or page heading or creation time)? | + | ### Can I sort the tree nodes (filename or page heading or creation time)? |
| + | Yes, You can sort pages with the tsort, dsort or msort [syntax](.: | ||
| - | Yes, You can sort pages with the tsort, dsort or msort [[.: | + | ### How can I activate the indexmenu as sidebar for every page? |
| - | + | - Enable the sidebar function in your template. See [FAQ sidebar](faq:sidebar) for configuration and installing. | |
| - | ==== How can I activate the indexmenu as sidebar for every page? ==== | + | |
| - | - Enable the sidebar function in your template. See [[faq:sidebar|FAQ sidebar]] | + | |
| - Add the indexmenu to the page used as sidebar. | - Add the indexmenu to the page used as sidebar. | ||
| 行 581: | 行 607: | ||
| - | ==== The tree is not updated | + | ### The tree is not updated |
| The tree is always immediately updated. So you have not to worry to use %%~~NOCACHE~~%% instruction, | The tree is always immediately updated. So you have not to worry to use %%~~NOCACHE~~%% instruction, | ||
| - | To purge cache either wait for the automatic [[config: | + | To purge cache either wait for the automatic [purge cache time](config: |
| - | ==== JS does not remember its previous state ==== | + | ### JS does not remember its previous state |
| + | Every _**js**_ indexmenu has an identifier (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 is reset because a new cookie (and consequently a new identifier) is generated. | ||
| - | Every // | + | This is not a problem because cache purge is not frequent, but if indexmenu |
| - | 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 an user loads the page, indexmenu behaviour is to not remember its previous state just like when '' | + | In this case, the solution is to force a permanent identifier through the _**[id# |
| - | + | ||
| - | In this case, the solution is to force a permanent identifier through the //**[[.: | + | |
| The identifier can be any number or the string " | The identifier can be any number or the string " | ||
| - | ==== I don't like the tree sliding arrow ==== | + | ### I don't like the tree sliding arrow |
| - | + | Create your own arrow in GIF format with an image editor, then override the default one in `dokuwiki/ | |
| - | Create your own arrow in GIF format with an image editor, then override the default one in '' | + | Change the height and width of the .indexmenu_arrow property in the [Css Style](.: |
| - | Change the height and width of the .indexmenu_arrow property in the [[.: | + | |
| You could need a browser cache purging. | You could need a browser cache purging. | ||
| - | ==== About ACLs ==== | + | ### About ACLs |
| + | |:!: First of all, you could need to correctly set the [Acl cache](.: | ||
| - | |:!: First of all, you could need to correctly set the [[.: | + | Indexmenu tree behaviour depends also on the [sneaky_index](config: |
| - | + | ||
| - | Indexmenu tree behaviour depends also on the [[config: | + | |
| * **Enabled**: | * **Enabled**: | ||
| 行 615: | 行 637: | ||
| * **Disabled**: | * **Disabled**: | ||
| - | In both cases, unauthorized pages are never showed. There are also some issues [[.: | + | 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 | ||
| | | ||
| 行 632: | 行 655: | ||
| | | ||
| | | ||
| - | </ | + | ``` |
| **Enabled** will display: | **Enabled** will display: | ||
| - | < | + | |
| + | ``` | ||
| +-Mysite | +-Mysite | ||
| | | ||
| 行 642: | 行 667: | ||
| | | ||
| | | ||
| - | </ | + | ``` |
| **Disabled** will display: | **Disabled** will display: | ||
| - | < | + | |
| + | ``` | ||
| +-Mysite | +-Mysite | ||
| | | ||
| 行 655: | 行 682: | ||
| | | ||
| | | ||
| - | </ | + | ``` |
| - | ==== About empty namespaces ==== | ||
| + | ### About empty namespaces | ||
| Empty namespace can occur when: | Empty namespace can occur when: | ||
| * All its pages were deleted. DokuWiki never does really remove empty namespaces as it stores them as file system directories. | * All its pages were deleted. DokuWiki never does really remove empty namespaces as it stores them as file system directories. | ||
| - | * All its pages and namespaces are skipped by [[.: | + | * All its pages and namespaces are skipped by [skip namespaces in index](.: |
| - | * All its pages and namespaces are denied to users by [[ACLs]] settings. | + | * All its pages and namespaces are denied to users by [ACLs](ACLs) |
| * It has got only a child page, this page is its headpage and hide_headpage option is enabled. | * It has got only a child page, this page is its headpage and hide_headpage option is enabled. | ||
| - | When the '' | + | 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 | + | When any of the sort options |
| - | **Why will sneaky_index hide forbidden namespaces**\\ | + | **Why will sneaky_index hide forbidden namespaces**\ |
| - | Enabling the '' | + | Enabling the `[sneaky_index](config: |
| - | ==== I'm using " | + | ### I'm using " |
| + | The text used for the nodes in the tree is retrieved from DokuWiki' | ||
| - | The text used for the nodes in the tree is retrieved from DokuWiki' | ||
| - | |||
| - | |||
| - | ====== Reporting feature requests and bugs====== | ||
| + | # Reporting feature requests and bugs | ||
| Please refer to https:// | Please refer to https:// | ||
| See also for additional info: | See also for additional info: | ||
| - | * [[.: | + | * [FAQ and notes](.: |
| - | * and [[plugin: | + | * and [Discussion](plugin: |
| - | ====== Discussion ====== | ||
| - | Please, use the [[.: | + | # Discussion |
| + | Please, use the [discussion](.: | ||
| + | Old discussions are archived in the [olddiscussion](.: | ||
wiki/插件语法/indexmenu.1666141730.txt.gz · 最后更改: (外部编辑)
