Template:Tree list
This template uses TemplateStyles: |
This family of templates can be used to create a properly structured and accessible tree. This can be used to display family trees, succession to thrones, etc. They comprise:
- {{Tree list}}
- {{Tree list/end}}
- {{Tree list/branching}}
Contents
Syntax[edit]
Start and finish of the tree[edit]
The tree must include a start and finish, using the templates {{Tree list}} and {{Tree list/end}} respectively. The tree is essentially a series of nested lists built with the asterisk *.
{{Tree list}}
* Here goes the content of the tree using asterisks.
{{Tree list/end}}
The branches of the tree[edit]
Each branch of the tree is built using nested lists:
{{Tree list}}
* A first level branch
** A second level branch
*** A third level branch
{{Tree list/end}}
produces
- A first level branch
- A second level branch
- A third level branch
- A second level branch
Unlabelled branches[edit]
An unlabelled branch may be formed by using the {{Tree list/branching}} template.
{{Tree list}}
* A first level branch
** {{Tree list/branching}}
*** A third level branch
*** Another third level branch
*** The final third level branch
** A second level branch
** {{Tree list/branching}} <!--- This branch ends the second level --->
*** A third level branch
*** The final third level branch
{{Tree list/end}}
produces the following:
- A first level branch
-
- A third level branch
- Another third level branch
- The final third level branch
- A second level branch
-
- A third level branch
- The final third level branch
-
Collapse[edit]
To collapse a tree place {{Hidden begin}}
before {{Tree list}}
and enclose {{Tree list/end}}
with {{Hidden end}}
. {{Hidden begin}}
default to just a show link on the right, but it takes a number of parameters see the template's documentation. In this case:
|border=1px #aaa solid — a solid border around the tree |title=Demonstration tree — a suitable name for the tree |ta1=center – center the title= name
{{hidden begin|border=1px #aaa solid|title=Demonstration tree|ta1=center}}
{{Tree list}}
* A first level branch
** {{Tree list/branching}}
*** A third level branch
*** Another third level branch
*** The final third level branch
** A second level branch
** {{Tree list/branching}} <!--- This branch ends the second level --->
*** A third level branch
*** The final third level branch
{{Tree list/end}}
{{Hidden end}}
- A first level branch
-
- A third level branch
- Another third level branch
- The final third level branch
- A second level branch
-
- A third level branch
- The final third level branch
-
If the parameter |expanded=on
is added to {{hidden begin}}
then the box will be drawn expanded rather than the default, which is to collapse the tree.
Examples[edit]
See also[edit]
{{Chart}}
— This template produces one row in a "family tree"-like chart consisting of boxes and connecting lines{{Ahnentafel}}
— This template takes genealogical data in the form of an ahnentafel and presents it as a graphical ancestry tree{{ahnentafel-tree}}
uses{{Tree list}}
and will handle up to an ahnentafel of 511 places (9 generations), but will also display as little as one generation.