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-12-22 13:14] – + description section nerunplugin: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 ===== ===== 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.
 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]].
Line 82: 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 98: 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) |
Line 112: Line 114:
 ^ ''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.**  ||| | \\ 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'' If initially closed, 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.| 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**//. |+^ ''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 ===== ===== 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. **It is deprecated.** It can be requested with the ''treeold'', if the default setting is changed.+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 ''newtree'' to the ''defaultoptions'' setting in the Configuration Manager. +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 124: 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 185: Line 187:
 in this way: in this way:
 <code> <code>
-{{indexmenu>..#1|msort}}+{{indexmenu>:#1|msort}}
 </code> </code>
 <file> <file>
Line 199: 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 273: 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 525: 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.1703247252.txt.gz · Last modified: 2023-12-22 13:14 by nerun

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