DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:navi

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:navi [2020-07-16 23:51] – version upped andiplugin:navi [2024-06-06 11:46] (current) – navigationmenu => mycontrolpage (better nudging) michaelsy
Line 6: Line 6:
 email      : dokuwiki@cosmocode.de email      : dokuwiki@cosmocode.de
 type       : syntax type       : syntax
-lastupdate : 2020-07-16 +lastupdate : 2023-02-15 
-compatible : Detritus, Hrun, Elenor Of Tsort, Greebo, Hogfather+compatible : Detritus, Hrun, Elenor Of Tsort, Greebo, Hogfather, Igor
 depends    :  depends    : 
 conflicts  conflicts 
Line 23: Line 23:
 ===== Download and Install ===== ===== Download and Install =====
  
-[[https://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ http://cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]]+[[https://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ https://www.cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]]
  
 Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
Line 36: Line 36:
 In the page defining the sidebar in your template add the following syntax: In the page defining the sidebar in your template add the following syntax:
  
-  {{navi>navigationmenu}}+  {{navi>mycontrolpage}}
  
-where ''navigationmenu'' is any other page containing an //unordered list of page links// --- this page we call the "control page".+where ''mycontrolpage'' is any other page containing an //unordered list of page links// --- this page we call the "control page".
  
 Notes: Notes:
Line 69: Line 69:
 Sometimes the navi plugin is used to create collapsible, editable navigation even though content is structured into nested namespaces. But since the plugin knows nothing about those namespaces by default it will collapse completely as soon as a page is opened that is not defined in the control page. Sometimes the navi plugin is used to create collapsible, editable navigation even though content is structured into nested namespaces. But since the plugin knows nothing about those namespaces by default it will collapse completely as soon as a page is opened that is not defined in the control page.
  
-By adding ''?ns'' to the navi plugin syntax, e.g. ''%%{{navi>navigationmenu?ns}}%%'', you can make the plugin to be clever about namespaces: When it is called on a page that is not mentioned on the control page, it will have a look at the namespace of the page. It then checks if a startpage for the namespace is to be found in the control page. If it is, it will be used as the current open branch, if not it is checked if there is //any// other page in the same namespace on the controlpage. If found it's used. This is repeated for each higher namespace until the top is reached or a matching page.+By adding ''?ns'' to the navi plugin syntax, e.g. ''%%{{navi>mycontrolpage?ns}}%%'', you can make the plugin to be clever about namespaces: When it is called on a page that is not mentioned on the control page, it will have a look at the namespace of the page. It then checks if a startpage for the namespace is to be found in the control page. If it is, it will be used as the current open branch, if not it is checked if there is //any// other page in the same namespace on the controlpage. If found it's used. This is repeated for each higher namespace until the top is reached or a matching page.
  
 ==== Displaying the Full Tree and dynamic JS ==== ==== Displaying the Full Tree and dynamic JS ====
Line 75: Line 75:
 Sometimes you may want to display the full navigation hierarchy (but still leave out pages without permission). Especially template authors may want to use this feature for mobile menus and such. You can do this by adding the ''full'' parameter: Sometimes you may want to display the full navigation hierarchy (but still leave out pages without permission). Especially template authors may want to use this feature for mobile menus and such. You can do this by adding the ''full'' parameter:
  
-  {{navi>navigationmenu?ns&full}}+  {{navi>mycontrolpage?ns&full}}
  
 If you want to use the full hierarchy but be able to open without page reloads, you can use the ''js'' parameter: If you want to use the full hierarchy but be able to open without page reloads, you can use the ''js'' parameter:
  
-  {{navi>navigationmenu?ns&js}}+  {{navi>mycontrolpage?ns&js}}
  
  
plugin/navi.1594936266.txt.gz · Last modified: by andi

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