DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:indexmenu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:indexmenu [2023-09-08 16:34] – [Examples:] add current namespace expands all because not that intuitive 78.121.109.166plugin:indexmenu [2024-04-29 06:22] (current) – [Temporary multiple js trees] 45.78.57.234
Line 6: Line 6:
 email      : samuele@samuele.netsons.org email      : samuele@samuele.netsons.org
 type       : syntax,action type       : syntax,action
-lastupdate : 2022-08-01 +lastupdate : 2024-01-05 
-compatible : Jack Jackrum, Igor,rincewindangua, adora belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus, Elenor Of Tsort, Frusterick Manners, Greebo, !Hogfather+compatible : !Greebo, !Hogfather, Igor, Jack JackrumKaos
 depends    : depends    :
 conflicts  : indexmenu2 conflicts  : indexmenu2
 similar    : alphaindex, indexmenu2, navi, simplenavi similar    : alphaindex, indexmenu2, navi, simplenavi
-tags       : navigation, menu, listing, namespace, ajax, index+tags       : navigation, menu, listing, namespace, index
  
 sourcerepo : https://github.com/samuelet/indexmenu sourcerepo : https://github.com/samuelet/indexmenu
Line 19: Line 19:
 ---- ----
  
-^ :!: If you use the Indexmenu's option 'js' in the Hogfather release (June 2020+)you have to disable the [[config:defer_js|defer_js feature flag]]. The indexmenu plugin does not support deferred javascript loading at the moment.\\ \\ Work-in-progress: [[https://github.com/samuelet/indexmenu/issues/230|issue #230]]  ^+^ :!: Since December 2023 two JavaScript trees are available for Indexmenu's option 'js'. For the (stilldefault js tree ''js treeold'' you have to disable the [[config:defer_js|defer_js feature flag]]. For the new ''js treenew'' you can enable deferred JavaScript loading again.\\ \\ To enable the new js tree for all trees, add ''treenew'' to the ''defaultoptions'' setting in the Configuration Manager.\\ \\ Note that the contextmenu (and ToC) are not supported for the new tree, please vote in: [[https://github.com/samuelet/indexmenu/issues/230|issue #230]] ^ 
 + 
 +===== Description =====
  
 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.
Line 61: Line 63:
  
 ====== Syntax ====== ====== Syntax ======
- 
-**Minimum syntax:** 
- 
-  * ''**%%{{indexmenu>.}}%%**'' 
-  * ''**%%{{indexmenu>:}}%%**'' 
-  * ''**%%{{indexmenu>|}}%%**'' 
- 
-That means this ''**%%{{indexmenu}}%%**'' and this ''**%%{{indexmenu>}}%%**'' do not work. 
  
 **Basic syntax usage:** **Basic syntax usage:**
Line 77: Line 71:
  
 :!: All the syntax options can be easily accessed with the indexmenu picker in the [[:edit window]] [[:toolbar]]. :!: All the syntax options can be easily accessed with the indexmenu picker in the [[:edit window]] [[:toolbar]].
 +
 +
 +**Minimum syntax:** 
 +
 +''%%{{indexmenu>.}}%%'', ''%%{{indexmenu>:}}%%'' or ''%%{{indexmenu>|}}%%''
 +That means this ''%%{{indexmenu}}%%'' and this ''%%{{indexmenu>}}%%'' do not work.
  
  
Line 83: Line 83:
 Settings **before the "|"** separator: Settings **before the "|"** separator:
 ^Main ^Action ^Note| ^Main ^Action ^Note|
-^ //''ns''//     | //**Main namespace**// name. Index starts from here. Syntax complies with DokuWiki [[:namespaces#creating namespaces|namespaces]] paths.| "**.**" refers to the namespace of the page containing the indexmenu syntax and **not** to the current DokuWiki namespace context ((the namespace of the page displayed by a user who is navigating your site)) (see the **//context//** option for this feature). "**..**" or an empty value shows the root site namespace.|+^ //''ns''//     | //**Main namespace**// name. Index starts from here. Syntax complies with DokuWiki [[:namespaces#creating namespaces|namespaces]] paths.| "**.**" refers to the namespace of the page containing the indexmenu syntax and **not** to the current DokuWiki namespace context ((the namespace of the page displayed by a user who is navigating your site)) (see the **//context//** option for this feature). "**:**" or an empty value shows the root site namespace.|
 ^ //''#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: "#2" will display "root:myns1:myns2" but will keep myns2 closed thus hiding "root:myns1:myns2:myns3". Optional.| ^ //''#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: "#2" will display "root:myns1:myns2" but will keep myns2 closed thus hiding "root:myns1:myns2:myns3". 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#creating namespaces|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 ((the namespace of the page displayed by a user who is navigating your site)) (see the **//context//** option for this feature). "**..**" or an empty value shows the root site namespace. 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#creating namespaces|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 ((the namespace of the page displayed by a user who is navigating your site)) (see the **//context//** option for this feature). "**:**" or an empty value shows the root site namespace. Optional.|
  
 Optional settings **after the "|"** separator (separated by spaces): Optional settings **after the "|"** separator (separated by spaces):
Line 99: Line 99:
 ^ ''hsort''   \\ undo: ''nohsort'' | Sort the headpages as defined by config setting [[config:startpage]] to the top |msort overrules hsort | ^ ''hsort''   \\ undo: ''nohsort'' | Sort the headpages as defined by config setting [[config:startpage]] to the top |msort overrules hsort |
 ^ ''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. | ^ ''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// to the above sort options. tsort, dsort, msort, hsort apply only for namespaces when using [[#namespaces_title_and_link_headpages|headpages]]. rsort is applicable always together with nsort.  |+^ ''nsort''   \\ undo: ''nonsort'' | Also sort namespaces according to page sort options together with the pages (not grouped separately anymore since January 2024). | To use in //addition// to the above sort options. tsort, dsort, msort, hsort apply only for namespaces when using [[#namespaces_title_and_link_headpages|headpages]]. rsort is applicable always together with nsort.  
 +^ ''nogroup'' \\ undo ''group'' | If ''nsort'' is used, ''nogroup'' mixes namespaces and pages to sort them together | |
 ^ ''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.| ^ ''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''  \\ undo: ''pg''  | Exclude pages nodes from index. It shows only the namespaces. | All namespace nodes will link to the start pages (as defined by [[config:startpage]] setting) | ^ ''nopg''  \\ undo: ''pg''  | Exclude pages nodes from index. It shows only the namespaces. | All namespace nodes will link to the start pages (as defined by [[config:startpage]] setting) |
 ^ ''skipfile[+|=]/regexp/'' | Skip files matching the regexp. | ''skipfile**+**/../'' skips files defined with this regexp additional to [[#skip_files_in_index|global skip]] config. ''skipfile**=**/../'' replace the global skip config with regexp from this syntax. See the global config explanation for some regexp [[#skip_namespaces_in_index|examples]].| ^ ''skipfile[+|=]/regexp/'' | Skip files matching the regexp. | ''skipfile**+**/../'' skips files defined with this regexp additional to [[#skip_files_in_index|global skip]] config. ''skipfile**=**/../'' replace the global skip config with regexp from this syntax. See the global config explanation for some regexp [[#skip_namespaces_in_index|examples]].|
 ^ ''skipns[+|=]/regexp/'' | Skip namespaces matching the regexp. | Just like skipfile, but [[#skip_namespaces_in_index|namespaces]].| ^ ''skipns[+|=]/regexp/'' | Skip namespaces matching the regexp. | Just like skipfile, but [[#skip_namespaces_in_index|namespaces]].|
-| Next options are //only// available with //**js**// option. |||+| Next options are //only// available with //**js**// option -- with ''treeold''.\\ \\ **Default ''dTree'' based tree is shown. Deprecated. Will be changed in future to ''treenew''.** |||
 ^ ''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**//. | ^ ''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//''  \\ undo: ''nomaxjs''   | 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**// | ^ ''maxjs#//n//''  \\ undo: ''nomaxjs''   | 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**// |
Line 112: Line 113:
 ^ ''notoc''  \\ undo: ''toc''        | Disable the TOC-preview feature. | ToC preview only available in //**js**//| ^ ''notoc''  \\ undo: ''toc''        | Disable the TOC-preview feature. | ToC preview only available in //**js**//|
 ^ ''nomenu''  \\ undo: ''menu''       | Disable the contextmenu feature. | Context menu only available in //**js**//| ^ ''nomenu''  \\ undo: ''menu''       | Disable the contextmenu feature. | Context menu only available in //**js**//|
 +| \\ Next options are //only// available with //**js**// option -- with ''treenew''. \\ \\ **Temporary: extra option ''treenew'' shows a Fancytree based tree. Will become the default in the future.**  |||
 +^ ''max#n//[#m]//'' \\ undo: ''nomax''  | For the initially closed nodes, it will retrieve all its child nodes up to //**n**//th level through the AJAX mechanism. Optionally, the nodes after the //**n**//th level can be retrieved with AJAX every //**m**//th sublevels instead of per 1 level. The number of opened levels is set behind the namespace, see main settings above.| 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**//. |
  
 +
 +===== Temporary multiple js trees =====
 +The js option uses so far the JavaScript [[http://www.destroydrop.com/javascripts/tree/|dTree]] menu for displaying the pages. Unfortunately, this tree is not maintained and changes are needed. **The old js tree is deprecated.** It can be requested with the ''treeold'', if the default setting is changed.
 +
 +To replace it, the JavaScript [[https://wwwendt.de/tech/fancytree/demo/|Fancytree]] menu is implemented. Use the option ''treenew'' to activate it. If the implementation appears to be stable, it will be come the default tree. You can already make it default by adding ''treenew'' to the ''defaultoptions'' setting in the Configuration Manager. 
  
 ===== Examples ===== ===== Examples =====
Line 118: Line 126:
 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't remember the open and closed nodes by the user: 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't remember the open and closed nodes by the user:
 <code> <code>
-{{indexmenu>..#1|js navbar nocookie}}+{{indexmenu>:#1|js navbar nocookie}}
 </code> </code>
  
 JS navigation index with "thread" theme where nodes after the third level are retrieved with Ajax every 2 sublevels. Pages are sorted by title and [[.indexmenu#Metadata tag syntax|custom sort]] number: JS navigation index with "thread" theme where nodes after the third level are retrieved with Ajax every 2 sublevels. Pages are sorted by title and [[.indexmenu#Metadata tag syntax|custom sort]] number:
 <code> <code>
-{{indexmenu>..#1|js#thread navbar max#3#2 tsort msort}}+{{indexmenu>:#1|js#thread navbar max#3#2 tsort msort}}
 </code> </code>
  
Line 179: Line 187:
 in this way: in this way:
 <code> <code>
-{{indexmenu>..#1|msort}}+{{indexmenu>:#1|msort}}
 </code> </code>
 <file> <file>
Line 193: Line 201:
 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:
 <code> <code>
-{{indexmenu>..#1|tsort msort}}+{{indexmenu>:#1|tsort msort}}
 </code> </code>
 <file> <file>
Line 267: Line 275:
 Set this option with a DokuWiki page ID (i.e: ''tools:index''), then create the page (i.e: ''tools:index'') and put inside it an indexmenu syntax like this: Set this option with a DokuWiki page ID (i.e: ''tools:index''), then create the page (i.e: ''tools:index'') and put inside it an indexmenu syntax like this:
 <code> <code>
-{{indexmenu>..|navbar}}+{{indexmenu>:|navbar}}
 </code> </code>
 or or
 <code> <code>
-{{indexmenu>..|js navbar nocookie}}+{{indexmenu>:|js navbar nocookie}}
 </code> </code>
 You may also want to hide this page in any indexmenu trees with the [[.:indexmenu#skip files in index]] option. You may also want to hide this page in any indexmenu trees with the [[.:indexmenu#skip files in index]] option.
Line 339: Line 347:
 ==== Github changelog ==== ==== Github changelog ====
  
-{{rss>https://github.com/samuelet/indexmenu/commits/master.atom date}} +{{rss>https://github.com/samuelet/indexmenu/commits/master.atom 10 date}}
- +
- +
-==== Release changelog ==== +
- +
-  * **2014-08-01** +
-      * Default options can be configured in Config Manager for whole wiki +
-      * Supports nolatin pagenames better +
-      * remove more empty nodes (only with indexmenu indexer, which is used when one of sort options added) +
-      * contextmenu can be translated as well +
- +
-  * **2013-04-24 Version 5.0**: +
-            * Reformat of all code to Dokuwiki code style +
-            * Rewrite all javascript to jQuery instead of old js api (includes improvements from [[tindexmenu]] plugin) +
-            * Added a new toolbar wizard +
-            * Used Dokuwikis javascript include mechanism +
-            * add ''hsort'' for sorting [[config:startpage]] pages to top of listing +
-            * Rewrite the ajax stuff into action plugin (not theme handling stuff) +
-            * Change configuration via menu js files to one file. +
-            * add option ''nomenu'' +
-            * Improved support for [[config:useheading]] option. Page titles are //only shown// when useheading is 'always' or 'navigation'. - by [[user>lupo49]] +
-            * Added syntax option to add ''skipfile+/regexp/'' and ''skipns+/regexp/''. Using ''+'' add regexp parallel to global config, using ''='' replaces the global config. +
-            * 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: Ajax completion supports Korean characters too. - by [[user>Samuele]]+
  
-  * **2009-08-29 Version 4.6**: 
-            * :!: //New Feature//: Namespace declaration complies with DokuWiki [[:namespaces#creating namespaces|namespaces]]. **Important before upgrading from previous versions**: according to the new DokuWiki syntax, a simple //main namespace// without relative declaration prefix (i.e: "playground") doesn't refer anymore to the subnamespace in the root namespace but in the **current** namespace. To refer to the root namespace, you need to prepend the ":" declaration to it. 
-            * //New Feature//: Added the //context// option. It resolves relative requested namespaces starting from the current user location instead of the page containing the indexmenu syntax. 
-            * :!: //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//: 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. 
-            * //Bug//: Fixed a bug which prevents page caching when it contains only indexmenu syntax. 
-            * //Bug//: Disable JS indexmenu cookies in preview mode. 
-            * //Bug//: Fixed an ACL issue. 
-            * //Bug//: Fixed UTF8 TOC preview bug. 
  
  
Line 394: Line 367:
 When the ''js'' option is used without //**#theme**// option, the JavaScript indexmenu will use the default theme. When the ''js'' option is used without //**#theme**// option, the JavaScript indexmenu will use the default theme.
  
-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 repositoryTo download themes directly into your DokuWiki serveryou need that the indexmenu images directory is writable by the web user. +The indexmenu has already a couple of themes included. Adding another theme is simply as adding another folder with the theme name filled with the relevant files. (As long as it is still available you can use the admin page for installing themes)If you share your themewe can add it to the collection as wellPlease offer the files by opening an issue at [[https://github.com/samuelet/indexmenu/issues|GitHub]].
-  +
-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://www.destroydrop.com/javascripts/tree/|dTree]] code. The JavaScript tree menu is based on [[http://www.destroydrop.com/javascripts/tree/|dTree]] code.
Line 425: Line 396:
 Use your theme with **''js#mytheme''** syntax. Use your theme with **''js#mytheme''** syntax.
  
-You can also customize a theme style further by creating its [[.:indexmenu#Custom theme CSS style|own css style]] as ''style.css'' file in theme folder next to the images.+You can also customize a theme style further by creating its [[#Custom theme CSS style|own css style]] as ''style.css'' file in theme folder next to the images.
  
 The default icons file format is GIF, but PNG and JPG are also supported. 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''. Default image size is 18x18px. Other sizes are possible, but requires additional css. The default icons file format is GIF, but PNG and JPG are also supported. 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''. Default image size is 18x18px. Other sizes are possible, but requires additional css.
Line 535: Line 506:
   - To have the last indexmenu version installed. For example check that its date is the same of [[.:indexmenu#changelog]] last release through the info button in plugin manager.   - To have the last indexmenu version installed. For example check that its date is the same of [[.:indexmenu#changelog]] last release through the info button in plugin manager.
   - To have used a correct [[.:indexmenu#syntax]].   - To have used a correct [[.:indexmenu#syntax]].
 +  - To have purged CSS and JavaScript and more as cached by DokuWiki. Go to the [[plugin:config|Configuration Manager]] and just resave, to refresh this caching.
   - To have purged your browser cache. Use ''Ctrl + R'' or ''Ctrl + F5''    - To have purged your browser cache. Use ''Ctrl + R'' or ''Ctrl + F5'' 
-  - To have purged server cache following the [[:caching#purging_the_cache]] instructions.:!: This is an important step. 
-  - 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 [[.:indexmenu#reporting_feature_requests_and_bugs]] section. If problem still persists, please, report the bug with details of your configuration in [[.:indexmenu#reporting_feature_requests_and_bugs]] section.
Line 557: Line 527:
 I have in my sidebar the following code  I have in my sidebar the following code 
 <code> <code>
-{{indexmenu>..#1| js navbar id#random }}+{{indexmenu>:#1| js navbar id#random }}
 </code> </code>
  
plugin/indexmenu.1694183672.txt.gz · Last modified: 2023-09-08 16:34 by 78.121.109.166

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki