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-10-29 13:13] Klap-inplugin: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 : 2023-09-17 +lastupdate : 2024-01-05 
-compatible : Elenor Of Tsort, Frusterick Manners, Greebo, Hogfather, Igor, Jack Jackrum+compatible : !Greebo, !Hogfather, Igor, Jack Jackrum, Kaos
 depends    : depends    :
 conflicts  : indexmenu2 conflicts  : indexmenu2
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 81: 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 97: 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 110: 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 116: 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 177: Line 187:
 in this way: in this way:
 <code> <code>
-{{indexmenu>..#1|msort}}+{{indexmenu>:#1|msort}}
 </code> </code>
 <file> <file>
Line 191: 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 265: 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 357: 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 388: 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 519: 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.1698581636.txt.gz · Last modified: 2023-10-29 13:13 by Klap-in

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