Here are some ways of using
TreePlugin's TREEVIEW tag.
Note that the children of each tree are presented in alphabetical order which is why a "Three" topic always preceeds a "Two" topic.
Lists
%TREEVIEW{web="Test" topic="TreeTop"
formatting="ullist"}%
TreeTop
%TREEVIEW{web="Test" topic="TreeTop"
formatting="ollist"}%
TreeTop - TheOne
- OneOne
- OneOneOne
- OneTwo
- OneTwoOne
- OneTwoTwo
- OneTwoTwoOne
- OneTwoTwoThree
- OneTwoTwoTwo
- TheThree
- ThreeOne
- ThreeThree
- ThreeThreeOne
- ThreeTwo
- TheTwo
Outlines
version 0.25 change: the topic's level is not included in the outlining.
%TREEVIEW{web="Test" topic="TreeTop" formatting="outline"}%
This is also the default for the tag (when foramtting is not set).
TreeTop 1
TheOne 1.1
OneOne 1.1.1
OneOneOne 1.2
OneTwo 1.2.1
OneTwoTwo 1.2.2.1
OneTwoTwoOne 1.2.2.2
OneTwoTwoThree 1.2.2.3
OneTwoTwoTwo 2
TheThree 2.1
ThreeOne 2.2
ThreeThree 2.2.1
ThreeThreeOne 2.3
ThreeTwo 3
TheTwo
%TREEVIEW{web="Test" topic="TreeTop" bookview="on"}%
Displays tree in bookview mode. See
TreeBookviewOutlineSample.
%TREEVIEW{web="Test" topic="WebHome" topic="TreeTop"
formatting="outline" format=" $outnum $topic
<blockquote>$summary</blockquote>"}%
TreeTop Some summary text.
1
TheOne Summary for TheOne
1.1
OneOne Summary for OneOne
1.1.1
OneOneOne Summary for OneOneOne
1.2
OneTwo Summary for OneTwo
1.2.1
OneTwoOne Summary for OneTwoOne
1.2.2
OneTwoTwo Summary for OneTwoTwo
1.2.2.1
OneTwoTwoOne Summary for OneTwoTwoOne
1.2.2.2
OneTwoTwoThree Summary for OneTwoTwoThree
1.2.2.3
OneTwoTwoTwo Summary for OneTwoTwoTwo
2
TheThree Summary for TheThree
2.1
ThreeOne Summary for ThreeOne
2.2
ThreeThree Summary for ThreeThree
2.2.1
ThreeThreeOne Summary for ThreeThreeOne
2.3
ThreeTwo Summary for ThreeTwo
3
TheTwo Summary for TheTwo
%TABLE{tableborder="0"}%
%TREEVIEW{web="Test" formating="outline" topic="TreeTop"
header="| out | topic |" format="| [[$urltreetopic=$topic][$outnum]] </a>
| $spacetopic |"}%
In the rendered version, clicking on the outline numbers will display that topic's subtree.
Headings
%TREEVIEW{web="Test" topic="TreeTop" formatting="hlist"}%
See
HeadingOutlineSample.
Nested tables
You can also group branches within tables, like these three examples.
This is neat....
%TREEVIEW{web="Test" topic="TreeTop" formatting="coloroutline:#ffeeff,#eeffee,#ffffee,#eeeeff,#ffeeee,#eeffff"
format=" $count [[$web.$topic][$spacetopic]]<br>"
formatbranch="<table cellspacing=5><tr><td width=\"20%\"> $parent
</td><td bgcolor=$level>$children</td></td></tr></table>"}%
This is kinda neat....
%TREEVIEW{web="Test" topic="WebHome" formatting="outline" format="
$count [[$web.$topic][$spacetopic]]<br>"
formatbranch="<table cellspacing=5><tr><td width=\"20%\"> $parent
</td><td bgcolor=black width=1></td><td bgcolor=>$children</td></td></tr></table>"}%
%TREEVIEW{web="Test" topic="TreeTop"
formatting="coloroutline:#AA6666,#66AA66,#6666AA"
format=" $count [[$web.$topic][$spacetopic]]<br>"
formatbranch="<table cellspacing=5><tr><td width=\"%20\"> $parent
</td><td bgcolor=$level width=1></td><td bgcolor=#eeeeee>$children</td></td></tr></table>"}%
Image Trees (new in 0.25!)
version 0.25
Use the
imageoutline formatting attribute to add images to the tree formats. This formatting style was added mainly to provide thread-like presentation of a topic tree.
The general format is: imageoutline:
mode :
images :
imageformat
%TREEVIEW{topic="TreeTop" stoplevel="3" formatting="imageoutline:thread"}%
Because of defaults, this is the same as:
%TREEVIEW{topic="TreeTop" stoplevel="3"
formatting="imageoutline:thread:I.gif,white.gif,T.gif,L.gif:<img src='$image' border=0>"
format="<table border=0 cellspacing=0 cellpadding=0><tr><td nowrap>$images</td><td style={font-size:12pt}>
$topic</td></tr></table>"}%
Go ahead swap in your own images....
%TREEVIEW{topic="TreeTop" stoplevel="3" formatting="imageoutline:threadexp"}%
Note: Leaves are delineated by plain right angles; opened branches, by empty boxes; and 'unopened' branches (eg, the OneTwoTwo topic) which have more subtopics underneath them, delineated by the +-icon._
Because of defaults, this is the same as:
%TREEVIEW{topic="TreeTop" stoplevel="3"
formatting="imageoutline:threadexp:I.gif,white.gif,T.gif,L.gif,oT.gif,oL.gif,pT.gif,pL.gif:<img src='$image' border=0>"
format="<table border=0 cellspacing=0 cellpadding=0><tr><td nowrap>$images</td><td style={font-size:12pt}>
$topic</td></tr></table>"}%
If you need to make changes, go for it.
If you need users to be able to expand closed tree nodes, you'll have to more fancy
JavaScript than I can deal with at the moment. You could also try this as a functional but clunky alternative (clicking any image, will go to that topic's tree view):
%TREEVIEW{topic="TreeTop" stoplevel="2" formatting="imageoutline:threadexp"
format="<table border=0 cellspacing=0 cellpadding=0><tr><td nowrap>
[[$urltreetopic=$topic\"] [$images]]</td><td style={font-size:12pt}> $topic</td></tr></table>
"}%
These are pretty ugly (the default relies on Apache icons). But if you need it...
%TREEVIEW{web="Test" topic="TreeTop" stoplevel="3"
formatting="imageoutline:folder"}%
Because of defaults, this is the same as:
%TREEVIEW{topic="TreeTop" stoplevel="3"
formatting="imageoutline:folder:white.gif,/icons/generic.gif,/icons/folder.open.gif,/icons/folder.gif:<img src='$image' border=0>"
format="<table border=0 cellspacing=0 cellpadding=0><tr><td nowrap height=35>$images</td><td> $topic</td></tr></table>"}%
Go ahead swap in your own images....
I'm not sure why this would be interesting.....
%TREEVIEW{topic="TreeTop" stoplevel="3"
formatting="imageoutline:single"}%
TreeTop
TheOne
OneOne
OneOneOne
OneTwo
OneTwoOne
OneTwoTwo
TheThree
ThreeOne
ThreeThree
ThreeThreeOne
ThreeTwo
TheTwo
Because of defaults, this is the same as:
%TREEVIEW{topic="TreeTop" stoplevel="3"
formatting="imageoutline:single:/icons/ball.red.gif:<img src='$image' border=0>"
format="$images $topic<br>"}%
--
SlavaKozlov - 28 Feb 2002