key Log In

You are here: wiki.fini > TWiki Web > TreePlugin

Start of topic | Skip to actions

TreePlugin

Enables dynamic generation of TWiki topic trees based on topics' parent-child relationships. Useful for dynamic sitemaps and threads.

TreePlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, for example, %INTERWIKIPLUGIN_SHORTDESCRIPTION%

  • One line description, shown in the TextFormattingRules topic:
  • Set SHORTDESCRIPTION = Dynamic generation of TWiki topic trees

  • Set DEBUG to 1 to get debug messages in data/debug.txt. Default: 0
  • Set DEBUG = 1

Syntax Rules

Adds the following tags:

  • %TREEVIEW% - displays a TWiki topic's children in a hierarchical fashion.

Attributes:

  • web - specify web
  • topic - specify tree's root topic (if none, will do the entire web)
  • formatting - specify the formatting method
  • stoplevel - the depth of the tree to show
  • header - header output
  • bookview - list topics in BookView form
  • format - specify the format for each node (outline & coloroutline). Format variable options:
    • $topic - the topic name
    • $web - the topic's web
    • $spacetopic - the topic with spaces
    • $summary - the topic's summary
    • $text - the topic's text (which will get rendered)
    • $author - the topic's last author
    • $modTime - the topic's modification time
    • $level - the tree depth of the topic (in whatever format)
    • $count - the topic's child position
    • $index - the index of the topic in the tree. Starts from one. Most useful when used in combination with TreeBrowserPlugin
    • $onum - outline number for the topic (eg, 1.3.4.2)
    • $url - the current topic's URL
  • formatbranch - specify the format for a group of children (outline & coloroutline)
    • $parent - the text of a node
    • $children - the text of all the node's children (if any)
  • levelprefix - specify a prefix to a node format. The prefix is inserted $level times at the beginning of the rendered node format (outline). It allows generation of trees using TWiki bullet list syntax thus enabling usage of TreePlugin in Combination with TreeBrowserPlugin.

Samples

See the following pages for sample usage and output.

Combination with TreeBrowserPlugin

%TREEBROWSER{"file" title="%WEB%"}%
%TREEVIEW{web="%WEB%" topic="GrandParent" formatting="outline" format="* $topic" levelprefix="   "}%

Limitations and Known Issues

  • The parameter web does not work correctly. The Tree gets rendered, but the WikiWords of the topics do not contain the web value, but refers to the current web. Since I have limited knowledge of perl OO, I can't repair for now. -- TWiki:Main.MartinRaabe - 16 Jan 2003

A workaround for that is to do something like: %TREEVIEW{web="TWiki"  formatting="outline" format="* $web.$topic" levelprefix="   "}%

Plugin Installation Instructions

Manual

Download the ZIP or TGZ file from TWiki:Plugins.TreePlugin and unzip it into your TWiki installation directory

Automatic

Download TreePlugin_installer from TWiki:Plugins.TreePlugin put it at the root of your TWiki installation and execute it from there.

Contents

File: Description:
data/TWiki/TreePlugin.txt Plugin topic
data/TWiki/TreePlugin.txt,v Version file of Plugin topic
data/Plugins/TreePluginSamples.txt Plugin Samples
data/Plugins/TreePluginSamples.txt,v Version file of Plugin Samples
data/Plugins/HeadingOutlineSample.txt Heading Outline Sample
data/Plugins/HeadingOutlineSample.txt,v Version file of Heading Outline Sample
data/Plugins/TreeBookviewOutlineSample.txt Tree Bookview Outline Sample
data/Plugins/TreeBookviewOutlineSample.txt,v Version file of Tree Bookview Outline Sample
lib/TWiki/Plugins/TreePlugin.pm Plugin Perl module
lib/TWiki/Plugins/TreePlugin/ColorNodeFormatter.pm Library component
lib/TWiki/Plugins/TreePlugin/FormatHelper.pm Library component
lib/TWiki/Plugins/TreePlugin/FormatOutlineNodeFormatter.pm Library component
lib/TWiki/Plugins/TreePlugin/HOutlineNodeFormatter.pm Library component
lib/TWiki/Plugins/TreePlugin/ImgNodeFormatter.pm Library component
lib/TWiki/Plugins/TreePlugin/ListNodeFormatter.pm Library component
lib/TWiki/Plugins/TreePlugin/TreePlugin/Node.pm Library component
lib/TWiki/Plugins/TreePlugin/NodeFormatter.pm Library component
lib/TWiki/Plugins/TreePlugin/OutlineNodeFormatter.pm Library component
lib/TWiki/Plugins/TreePlugin/TWikiNode.pm Library component
lib/TWiki/Plugins/TreePlugin/test.tar.gz Test files
pub/TWiki/TreePlugin/I.gif tree icon
pub/TWiki/TreePlugin/L.gif tree icon
pub/TWiki/TreePlugin/oL.gif tree icon
pub/TWiki/TreePlugin/oT.gif tree icon
pub/TWiki/TreePlugin/pL.gif tree icon
pub/TWiki/TreePlugin/pT.gif tree icon
pub/TWiki/TreePlugin/T.gif tree icon
pub/TWiki/TreePlugin/white.gif tree icon
templates/booktree.tmpl Template for bookview mode

  • Unzip TreePlugin.zip in your twiki installation directory.
  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
  • If you see a tree of this topic here:

then installation was successful.

Plugin Info

One Line Description: View Twiki topics as nodes in a tree
Plugin Author: TWiki:Main.SlavaKozlov
Plugin Version: v0.6
Change History:  
1 Oct 2006: (v0.6) - TWiki:Main.StephaneLenclud: adding $index format subsitution. Useful when used in combination with TreeBrowserPlugin?. Also attempting to restore compatibility with Cairo, but still waiting for someone to test it.
16 Sep 2006: (v0.5) - TWiki:Main.StephaneLenclud: adding levelprefix parameter to unable usage in combination with TreeBrowserPlugin?.
26 Jul 2006: (v0.4) - TWiki:Main.SteffenPoulsen: Ported to TWiki-4 / Dakar. Leading text removed, less warnings, no double bracket links, css classnames around output.
15 Feb 2002: Alpha (0.2) release
08 Feb 2002: Internal (0.1) release
CPAN Dependencies: none (test package relies on Wiki:PerlUnit)
Other Dependencies: none
Perl Version: 5.0, 5.6.1, 5.8.7
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/TreePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/TreePluginDev

Related Topics: TWikiPreferences, TWikiPlugins, TWiki:Plugins.TreeBrowserPlugin

Copyright

This code is protected by the following copyrights:
  • Copyright (C) 2002 Slava Kozlov. All Rights Reserved.

License

As required for the publication of all extensions to TWiki, this software is published under the terms of the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details, published at http://www.gnu.org/copyleft/gpl.html

-- TWiki:Main.SlavaKozlov - 16 Feb 2002

toggleopenShow attachmentstogglecloseHide attachments
Topic attachments
I Attachment Action Size Date Who Comment
gifgif oT.gif manage 0.9 K 01 Oct 2006 - 16:08 UnknownUser  
gifgif I.gif manage 0.8 K 01 Oct 2006 - 16:08 UnknownUser  
gifgif white.gif manage 0.1 K 01 Oct 2006 - 16:08 UnknownUser  
gifgif pL.gif manage 0.9 K 01 Oct 2006 - 16:08 UnknownUser  
gifgif oL.gif manage 0.9 K 01 Oct 2006 - 16:08 UnknownUser  
gifgif L.gif manage 0.8 K 01 Oct 2006 - 16:08 UnknownUser  
gifgif T.gif manage 0.9 K 01 Oct 2006 - 16:08 UnknownUser  
gifgif pT.gif manage 0.9 K 01 Oct 2006 - 16:08 UnknownUser  

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding wiki.fini? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.TreePlugin