DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:twistienav

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:twistienav [2017-03-11 03:03] Geekitudeplugin:twistienav [2020-04-16 08:22] (current) Geekitude
Line 4: Line 4:
 description: Adds drop-down navigation menus to breadcrumbs (and eventually "pageId" element) description: Adds drop-down navigation menus to breadcrumbs (and eventually "pageId" element)
 author     : Simon Delage (original author: Håkan Sandell) author     : Simon Delage (original author: Håkan Sandell)
-email      : simon.geekitude@gmail.com +email      : sdelage@gmail.com 
 type       : Action type       : Action
-lastupdate : 2017-03-11 +lastupdate : 2020-04-16 
-compatible : Angua, Adora Belle, !2014-09-29 "Hrun", DetritusDetritus, Elenor Of Tsort+compatible : Angua, Adora Belle, !2014-09-29 "Hrun", Detritus, Elenor Of Tsort, Frusterick Manners, Greebo
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : navigation, menu, breadcrumb, index, breadcrumbs+tags       : navigation, menu, breadcrumb, index
  
 downloadurl: https://github.com/geekitude/dokuwiki-plugin-twistienav/archive/master.zip downloadurl: https://github.com/geekitude/dokuwiki-plugin-twistienav/archive/master.zip
Line 25: Line 25:
 ===== Installation ===== ===== Installation =====
  
-:!This plugin now probably requires "Detritus" or later version+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually. 
  
 ===== Basic Usage ===== ===== Basic Usage =====
Line 42: Line 41:
   * [''You are here''] has to be a collection of links wrapped into a ''div'' with ''youarehere'' class   * [''You are here''] has to be a collection of links wrapped into a ''div'' with ''youarehere'' class
   * [''Breadcrumbs''] has to be a collection of links wrapped into a ''div'' with ''trace'' class   * [''Breadcrumbs''] has to be a collection of links wrapped into a ''div'' with ''trace'' class
-  * [''pageId''] has to be a ''span'' wrapped into a ''div'' with ''pageId'' class+  * [''pageId''] has to be wrapped into an HTML element (e.g. `<div>`, `<span>`, ...) with ''pageId'' class
  
 ===== Get more ===== ===== Get more =====
Line 48: Line 47:
 ==== Settings ==== ==== Settings ====
  
-  * **startPagesOnly** : only add TwistieNavs to breadcrumbs leading to a namespace start page [default: enabled]. If disabled, any breadcrumb can recieve a TwistieNav (as long as it leads to a namespace containing more than excluded pages). +  * **startPagesOnly**: only add TwistieNavs to breadcrumbs leading to a namespace start page [default: enabled]. If disabled, any breadcrumb can recieve a TwistieNav (as long as it leads to a namespace containing more than excluded pages). 
-  * **exclusions** : only add TwistieNavs to breadcrumbs leading to namespaces containing more than any combination of selected pages. By default, both ''start'' and ''sidebar''pages are excluded. You can add custom exclusions with the text field (add page names as a comma separated list like ''topbar,other_sample''). :!: **IMPORTANT:** start pages shouldn't be excluded if ''startPagesOnly'' isn't enabled and will however never be excluded from 'pageId' TwistieNavs. +  * **exclusions**: only add TwistieNavs to breadcrumbs leading to namespaces containing more than any combination of selected pages. By default, both ''start'' and ''sidebar'' pages are excluded. You can add custom exclusions with the text field (add page names as a comma separated list like ''topbar,other_sample'' or first level namespaces with an ''@'' like ''@wiki''). Note that current page and playground are both **always excluded**. :!: **IMPORTANT:** start pages shouldn't be excluded if ''startPagesOnly'' isn't enabled and will however never be excluded from 'pageId' TwistieNavs. 
-  * **twistieMap** : if enabled, TwistieNavs showing wiki home index will use a map glyph instead of default one [default: disabled]. +  * **twistieMap**: if enabled, TwistieNavs showing wiki home index will use a map glyph instead of default one [default: disabled]. 
-  * **pageIdTrace** : if enabled, the plugin will look for a ''pageId'' HTML element and turn it into a short hierarchical trace [default: disabled] (see [[plugin:twistienav#pageid_trace|below]] for details).+  * **pageIdTrace**: if enabled and in //show// mode, the plugin will look for a ''pageId'' HTML element and turn it into a short hierarchical trace [default: disabled] (see [[plugin:twistienav#pageid_trace|below]] for details).
   * **pageIdExtraTwistie** : if enabled, the plugin will look for a ''pageId'' HTML element and attempt to add an extra TwistieNav that will show a popup with global index [default: enabled].   * **pageIdExtraTwistie** : if enabled, the plugin will look for a ''pageId'' HTML element and attempt to add an extra TwistieNav that will show a popup with global index [default: enabled].
-  * **style** : choose between SVG images and Font Awesome glyphs. :!: **IMPORTANT:** Font Awesome has to be loaded by the template or by a plugin, it is too heavy to be worth including it in TwistieNav.+  * **style**: choose between SVG images and Font Awesome glyphs. :!: **IMPORTANT:** Font Awesome has to be loaded by the template or by a plugin, it is too heavy to be worth including it in TwistieNav.
  
 ==== PageId trace ==== ==== PageId trace ====
  
-If the corresponding setting is enabled, TwistieNav will search a [''pageId''] element (usually a pseudo tab in top right corner of content with current page ID) and try to turn it into a short hierarchical trace with text links to open popups.+If **pageIdTrace** setting is enabled, TwistieNav will search a [''pageId''] element (usually a pseudo tab in top right corner of content with current page ID) and try to turn it into a short hierarchical trace with text links to open navigation popups.
  
 {{http://www.geekitude.fr/externe/dokuwiki/twistienav/twistienav_pageidtrace.jpg}} {{http://www.geekitude.fr/externe/dokuwiki/twistienav/twistienav_pageidtrace.jpg}}
Line 67: Line 66:
 Latest version uses a selection of SVG images (and corresponding PNG images) from [[https://icomoon.io|IcoMoon]] or Font Awesome glyphs (if your template or a plugin loads it). In addition, I included old plugin's PNGs (but only in that format). Latest version uses a selection of SVG images (and corresponding PNG images) from [[https://icomoon.io|IcoMoon]] or Font Awesome glyphs (if your template or a plugin loads it). In addition, I included old plugin's PNGs (but only in that format).
  
-The available images are :+The available images are:
  
 {{http://www.geekitude.fr/externe/dokuwiki/twistienav/twistienav_images.jpg}} {{http://www.geekitude.fr/externe/dokuwiki/twistienav/twistienav_images.jpg}}
Line 80: Line 79:
 Paths to images will have to be relative to the user style file you use. Paths to images will have to be relative to the user style file you use.
  
-===== Development =====+==== Helper Component ====
  
-=== Change Log ===+TwistieNav now has a helper component that can be called by plugins or templates (feature added in **2019-01-24** version).
  
- :!: 2016/05/08 version prevents popups from going off-screen ([[https://github.com/geekitude/dokuwiki-plugin-twistienav/issues/2|see details]]+=== Sample Code ===
  
- :!: 2016/05/03 version brings many changes (//urlrewriting// and regular breadcrumbs support)+<code> 
 +    $nsindex = array(); 
 +    if (!plugin_isdisabled('twistienav')) { 
 +        $tnHelper = plugin_load('helper','twistienav'); 
 +        $nsindex = $tnHelper->get_idx_data(cleanID(getNS($ID)), false, false); 
 +    } 
 +</code>
  
-{{rss>https://github.com/geekitude/dokuwiki-plugin-twistienav/commits/master.atom date}}+Parameters are : 
 +  * @param (str) $idx : namespace ID, :!: must not be a page ID, see above how to provide correct ID 
 +  * @param (bool) $useexclusions : use `exclusions` setting or not 
 +  * @param (bool) $split : return a simple level or more complex array
  
-=== Wish List ===+=== Sample Results ===
  
-  * <del>:!support for URL re-write</del> (done with 2016-05-03 version+//Elements #0 and #1 are both sub-namespaces (note the "d" for "directory" ''[type]'' value) while third one is just a page in target namespace (note it's "f" for "file" ''[type]'' value).// 
-  <del>add support for [[config:startpage|Configuration Setting: start]]</del> (should be ok with 2016-05-01 version)+ 
 +== Basic ("false" split parameter) == 
 + 
 +<code> 
 +Array 
 +
 +    [0] => Array 
 +        ( 
 +            [id] =fr:test:start 
 +            [ns] => fr 
 +            [perm] => 255 
 +            [type] => d 
 +            [level] => 1 
 +            [open] =>  
 +            [link] => <a href="/doku.php?id=fr:test:start" class="is_ns wikilink1">test.first.first.first.first.first</a> 
 +        ) 
 + 
 +    [1] => Array 
 +        ( 
 +            [id] => fr:toto:start 
 +            [ns] => fr 
 +            [perm] => 255 
 +            [type] => d 
 +            [level] => 1 
 +            [open] =>  
 +            [link] => <a href="/doku.php?id=fr:toto:start" class="is_ns wikilink2">toto</a> 
 +        
 + 
 +    [2] => Array 
 +        ( 
 +            [id] => fr:sidebar 
 +            [ns] => fr 
 +            [perm] => 255 
 +            [type] => f 
 +            [level] => 1 
 +            [open] => 1 
 +            [link] => <a href="/doku.php?id=fr:sidebar" class="is_page wikilink1">test</a> 
 +        ) 
 +
 +</code> 
 + 
 +== More structures ("true" split parameter) == 
 + 
 +<code> 
 +Array 
 +
 +    [namespaces] => Array 
 +        ( 
 +            [0] => Array 
 +                ( 
 +                    [id] => fr:test:start 
 +                    [ns=> fr 
 +                    [perm=> 255 
 +                    [type] => d 
 +                    [level] => 1 
 +                    [open] =>  
 +                    [link] => <a href="/doku.php?id=fr:test:start" class="is_ns wikilink1">test.first.first.first.first.first</a> 
 +                ) 
 + 
 +            [1] => Array 
 +                ( 
 +                    [id] => fr:toto:start 
 +                    [ns] => fr 
 +                    [perm] => 255 
 +                    [type] => d 
 +                    [level] => 1 
 +                    [open] =>  
 +                    [link] => <a href="/doku.php?id=fr:toto:start" class="is_ns wikilink2">toto</a> 
 +                ) 
 + 
 +        ) 
 + 
 +    [pages] => Array 
 +        ( 
 +            [0] => Array 
 +                ( 
 +                    [id] => fr:sidebar 
 +                    [ns] => fr 
 +                    [perm] => 255 
 +                    [type] => f 
 +                    [level] => 1 
 +                    [open] => 1 
 +                    [link] => <a href="/doku.php?id=fr:sidebar" class="is_page wikilink1">test</a> 
 +                ) 
 +        ) 
 +
 +</code> 
 + 
 +===== Development ===== 
 + 
 +=== Change Log === 
 + 
 +{{rss>https://github.com/geekitude/dokuwiki-plugin-twistienav/commits/master.atom date 5}} 
 + 
 +See [[https://github.com/geekitude/dokuwiki-plugin-twistienav/commits/master|Github]] for older data
  
 ===== FAQ ===== ===== FAQ =====
Line 107: Line 209:
 :?: I enabled ''pageIdTrace'' (or ''pageIdExtraTwistie'') but nothing is added to templates' "pageId" element. :?: I enabled ''pageIdTrace'' (or ''pageIdExtraTwistie'') but nothing is added to templates' "pageId" element.
  
-:!: The plugin can only interfere with template's "paegId" if it's HTML markup is close Dokuwiki's default template. Let me know wich template you use and I'll see if I can fix that.+:!: The plugin can only interfere with template's "pageId" if it's HTML markup is close Dokuwiki's default template's HTML markup (ie. uses a class named ''pageid''). Let me know wich template you use and I'll see if I can fix that.
  
 <del>:?: Once TwistieNav is enabled, "you are here" separation character between links are removed, is this normal ? <del>:?: Once TwistieNav is enabled, "you are here" separation character between links are removed, is this normal ?
  
 :!: Currently it is, will see later if it is requested by users.</del> :!: Currently it is, will see later if it is requested by users.</del>
 +
 ===== Discussion ===== ===== Discussion =====
  
-Please use [[https://github.com/geekitude/dokuwiki-plugin-twistienav/issues|Github issue tracker]] or [[https://forum.dokuwiki.org/thread/13653|this forum thread]].+Please use [[https://github.com/geekitude/dokuwiki-plugin-twistienav/issues|GitHub issue tracker]] or [[https://forum.dokuwiki.org/thread/13653|this forum thread]].
plugin/twistienav.1489197818.txt.gz · Last modified: 2017-03-11 03:03 by Geekitude

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