Template:Tree list/doc: Difference between revisions
cr-mizaheze>CaptainOfTheTidesBreath fix |
m remove unnecessary template references |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{When on basepage|{{Uses TemplateStyles|Template:Tree list/styles.css}}}} | |||
{{redirect-distinguish|Template:Tree diagram|Template:Tree chart}} | |||
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: | 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}} | ||
* {{tl|Tree list}} | * {{tl|Tree list}}/<nowiki>{{</nowiki>'''Tree list/start'''<nowiki>}}</nowiki> | ||
** {{tl|Tree list/end}} | ** {{tl|Tree list/end}} | ||
** {{tl|Tree list/branching}} | ** {{tl|Tree list/branching}} | ||
| Line 59: | Line 61: | ||
==Collapse== | ==Collapse== | ||
To collapse a tree place {{tlx|Hidden begin}} before {{tlx|Tree list}} and enclose {{tlx|Tree list/end}} with {{tlx|Hidden end}}. {{tlx|Hidden begin}} | To collapse a tree place {{tlx|Hidden begin}} before {{tlx|Tree list}} and enclose {{tlx|Tree list/end}} with {{tlx|Hidden end}} (see [[MOS:DONTHIDE]] before hiding content in articles). {{tlx|Hidden begin}} defaults 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 | |border=1px #aaa solid—a solid border around the tree | ||
|title=Demonstration | |title=Demonstration tree—a suitable name for the tree | ||
|ta1=center – center the title= name | |ta1=center – center the title= name | ||
| Line 98: | Line 100: | ||
== Examples == | == Examples == | ||
===A family tree === | ===A family tree === | ||
'''Code :''' | {{see also|Wikipedia:Family trees}} | ||
'''Code:''' | |||
<syntaxhighlight lang="wikitext"> | <syntaxhighlight lang="wikitext"> | ||
{{hidden begin|border=1px #aaa solid|title=A family tree (descendants of Henry VII of England)|ta1=center|expanded=on}} | {{hidden begin|border=1px #aaa solid|title=A family tree (descendants of Henry VII of England)|ta1=center|expanded=on}} | ||
{{Tree list}} | {{Tree list}} | ||
* | *'''(1)''' [[Henry VII of England|Henry VII]] (1457–1509) | ||
**Arthur, Prince of Wales ( | **[[Arthur, Prince of Wales]] (1486–1502) | ||
**Margaret Tudor|Margaret, Queen of Scots ( | **[[Margaret Tudor|Margaret, Queen of Scots]] (1489–1541) | ||
***James, Duke of Rothesay ( | ***[[James, Duke of Rothesay]] (1507–1508) | ||
***Arthur, Duke of Rothesay ( | ***[[Arthur, Duke of Rothesay]] (1509–1510) | ||
***[[ | ***[[James V of Scotland]] (1512–1542) | ||
****[[ | ****[[Mary, Queen of Scots]] (1542–1587) | ||
***** | ***** '''(7)''' [[James VI and I|James VI of Scotland and I of England]] (1566–1625) | ||
******''From whom succeeding English, Scottish and British monarchs are descended.'' | ******''From whom succeeding English, Scottish and British monarchs are descended.'' | ||
***Alexander Stewart, Duke of Ross ( | ***[[Alexander Stewart, Duke of Ross]] (1514–1515) | ||
***Margaret Douglas|Margaret Douglas, Countess of Lennox ( | ***[[Margaret Douglas|Margaret Douglas, Countess of Lennox]] (1515–1578) | ||
** | ** '''(2)''' [[Henry VIII of England]] (1491–1547) | ||
***Henry, Duke of Cornwall ( | ***[[Henry, Duke of Cornwall]] (1511–1511) | ||
*** | *** '''(5)''' [[Mary I of England]] (1516–1558) | ||
*** | *** '''(6)''' [[Elizabeth I of England]] (1533–1603) | ||
*** | *** '''(3)''' [[Edward VI of England]] | ||
**Elizabeth Tudor (daughter of Henry VII)|Elizabeth Tudor ( | **[[Elizabeth Tudor (daughter of Henry VII)|Elizabeth Tudor]] (1492–1495) | ||
**Mary Tudor (queen consort of France)|Mary, Queen of France ( | **[[Mary Tudor (queen consort of France)|Mary, Queen of France]] (1496–1533) | ||
***Henry Brandon ( | ***Henry Brandon (1516–1522) | ||
***Frances Grey, Duchess of Suffolk ( | ***[[Frances Grey, Duchess of Suffolk]] (1517–1547) | ||
**** | **** '''(4)''' [[Lady Jane Grey]] (1536–1553) | ||
****Lady Catherine Grey|Catherine Seymour, Countess of Hertford ( | ****[[Lady Catherine Grey|Catherine Seymour, Countess of Hertford]] (1540–1568) | ||
****Lady Mary Grey|Lady Mary Keyes ( | ****[[Lady Mary Grey|Lady Mary Keyes]] (1545–1578) | ||
****Elizabeth Stokes ( | ****Elizabeth Stokes (1555–1556) | ||
***Eleanor Clifford, Countess of Cumberland ( | ***[[Eleanor Clifford, Countess of Cumberland]] (1519–1547) | ||
****''From whom are descended the Earl of Derby|Earls of Derby'' | ****''From whom are descended the [[Earl of Derby|Earls of Derby]]'' | ||
***Henry Brandon, 1st Earl of Lincoln ( | ***[[Henry Brandon, 1st Earl of Lincoln]] (1523–1534) | ||
**Edmund Tudor, Duke of Somerset ( | **[[Edmund Tudor, Duke of Somerset]] (1499–1500) | ||
**Katherine Tudor (1503)|Katherine Tudor ( | **[[Katherine Tudor (1503)|Katherine Tudor]] (1503–1503) | ||
{{Tree list/end}} | {{Tree list/end}} | ||
{{hidden end}} | {{hidden end}} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
which gives | which gives: | ||
{{hidden begin|border=1px #aaa solid|title=A family tree (descendants of Henry VII of England) |ta1=center|expanded=on}} | {{hidden begin|border=1px #aaa solid|title=A family tree (descendants of Henry VII of England) |ta1=center|expanded=on}} | ||
{{Tree list}} | {{Tree list}} | ||
* | * '''(1)''' Henry VII of England|Henry VII (1457–1509) | ||
**Arthur, Prince of Wales ( | **Arthur, Prince of Wales (1486–1502) | ||
**Margaret, Queen of Scots ( | **Margaret Tudor|Margaret, Queen of Scots (1489–1541) | ||
***James, Duke of Rothesay ( | ***James, Duke of Rothesay (1507–1508) | ||
***Arthur, Duke of Rothesay ( | ***Arthur, Duke of Rothesay (1509–1510) | ||
*** | *** James V of Scotland (1512–1542) | ||
**** | **** Mary, Queen of Scots (1542–1587) | ||
***** | ***** '''(7)''' James VI and I|James VI of Scotland and I of England (1566–1625) | ||
******''From whom succeeding English, Scottish and British monarchs are descended.'' | ******''From whom succeeding English, Scottish and British monarchs are descended.'' | ||
***Alexander Stewart, Duke of Ross ( | ***Alexander Stewart, Duke of Ross (1514–1515) | ||
***Margaret Douglas, Countess of Lennox ( | ***Margaret Douglas|Margaret Douglas, Countess of Lennox (1515–1578) | ||
** | ** '''(2)''' Henry VIII of England (1491–1547) | ||
***Henry, Duke of Cornwall ( | ***Henry, Duke of Cornwall (1511–1511) | ||
*** | *** '''(5)''' Mary I of England (1516–1558) | ||
*** | *** '''(6)''' Elizabeth I of England (1533–1603) | ||
*** | *** '''(3)''' Edward VI of England | ||
**Elizabeth Tudor (daughter of Henry VII)|Elizabeth Tudor ( | **Elizabeth Tudor (daughter of Henry VII)|Elizabeth Tudor (1492–1495) | ||
**Mary Tudor (queen consort of France)|Mary, Queen of France ( | **Mary Tudor (queen consort of France)|Mary, Queen of France (1496–1533) | ||
***Henry Brandon ( | ***Henry Brandon (1516–1522) | ||
***Frances Grey, Duchess of Suffolk ( | ***Frances Grey, Duchess of Suffolk (1517–1547) | ||
**** | **** '''(4)''' Lady Jane Grey (1536–1553) | ||
****Catherine Seymour, Countess of Hertford ( | ****Lady Catherine Grey|Catherine Seymour, Countess of Hertford (1540–1568) | ||
****Lady Mary Keyes ( | ****Lady Mary Grey|Lady Mary Keyes (1545–1578) | ||
****Elizabeth Stokes ( | ****Elizabeth Stokes (1555–1556) | ||
***Eleanor Clifford, Countess of Cumberland ( | ***Eleanor Clifford, Countess of Cumberland (1519–1547) | ||
****''From whom are descended the Earls of Derby'' | ****''From whom are descended the Earl of Derby|Earls of Derby'' | ||
***Henry Brandon, 1st Earl of Lincoln ( | ***Henry Brandon, 1st Earl of Lincoln (1523–1534) | ||
**Edmund Tudor, Duke of Somerset ( | **Edmund Tudor, Duke of Somerset (1499–1500) | ||
**Katherine Tudor (1503 | **Katherine Tudor (1503)|Katherine Tudor (1503–1503) | ||
{{Tree list/end}} | {{Tree list/end}} | ||
{{hidden end}} | {{hidden end}} | ||
<includeonly>[[Category: | |||
<includeonly> | |||
[[Category:family tree templates]] | |||
}}</includeonly> | |||
Latest revision as of 20:12, 21 November 2025
Template:When on basepage Template:Redirect-distinguish 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:
- Template:Tl/{{Tree list/start}}
Syntax
Start and finish of the tree
The tree must include a start and finish, using the templates Template:Tl and Template:Tl 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
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
An unlabelled branch may be formed by using the Template:Tl 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
To collapse a tree place Template:Tlx before Template:Tlx and enclose Template:Tlx with Template:Tlx (see MOS:DONTHIDE before hiding content in articles). Template:Tlx defaults 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 Template:Tlx then the box will be drawn expanded rather than the default, which is to collapse the tree.
Examples
A family tree
- See also: Wikipedia:Family trees
Code:
{{hidden begin|border=1px #aaa solid|title=A family tree (descendants of Henry VII of England)|ta1=center|expanded=on}}
{{Tree list}}
*'''(1)''' [[Henry VII of England|Henry VII]] (1457–1509)
**[[Arthur, Prince of Wales]] (1486–1502)
**[[Margaret Tudor|Margaret, Queen of Scots]] (1489–1541)
***[[James, Duke of Rothesay]] (1507–1508)
***[[Arthur, Duke of Rothesay]] (1509–1510)
***[[James V of Scotland]] (1512–1542)
****[[Mary, Queen of Scots]] (1542–1587)
***** '''(7)''' [[James VI and I|James VI of Scotland and I of England]] (1566–1625)
******''From whom succeeding English, Scottish and British monarchs are descended.''
***[[Alexander Stewart, Duke of Ross]] (1514–1515)
***[[Margaret Douglas|Margaret Douglas, Countess of Lennox]] (1515–1578)
** '''(2)''' [[Henry VIII of England]] (1491–1547)
***[[Henry, Duke of Cornwall]] (1511–1511)
*** '''(5)''' [[Mary I of England]] (1516–1558)
*** '''(6)''' [[Elizabeth I of England]] (1533–1603)
*** '''(3)''' [[Edward VI of England]]
**[[Elizabeth Tudor (daughter of Henry VII)|Elizabeth Tudor]] (1492–1495)
**[[Mary Tudor (queen consort of France)|Mary, Queen of France]] (1496–1533)
***Henry Brandon (1516–1522)
***[[Frances Grey, Duchess of Suffolk]] (1517–1547)
**** '''(4)''' [[Lady Jane Grey]] (1536–1553)
****[[Lady Catherine Grey|Catherine Seymour, Countess of Hertford]] (1540–1568)
****[[Lady Mary Grey|Lady Mary Keyes]] (1545–1578)
****Elizabeth Stokes (1555–1556)
***[[Eleanor Clifford, Countess of Cumberland]] (1519–1547)
****''From whom are descended the [[Earl of Derby|Earls of Derby]]''
***[[Henry Brandon, 1st Earl of Lincoln]] (1523–1534)
**[[Edmund Tudor, Duke of Somerset]] (1499–1500)
**[[Katherine Tudor (1503)|Katherine Tudor]] (1503–1503)
{{Tree list/end}}
{{hidden end}}which gives: Template:Hidden begin
- (1) Henry VII of England|Henry VII (1457–1509)
- Arthur, Prince of Wales (1486–1502)
- Margaret Tudor|Margaret, Queen of Scots (1489–1541)
- James, Duke of Rothesay (1507–1508)
- Arthur, Duke of Rothesay (1509–1510)
- James V of Scotland (1512–1542)
- Mary, Queen of Scots (1542–1587)
- (7) James VI and I|James VI of Scotland and I of England (1566–1625)
- From whom succeeding English, Scottish and British monarchs are descended.
- (7) James VI and I|James VI of Scotland and I of England (1566–1625)
- Mary, Queen of Scots (1542–1587)
- Alexander Stewart, Duke of Ross (1514–1515)
- Margaret Douglas|Margaret Douglas, Countess of Lennox (1515–1578)
- (2) Henry VIII of England (1491–1547)
- Henry, Duke of Cornwall (1511–1511)
- (5) Mary I of England (1516–1558)
- (6) Elizabeth I of England (1533–1603)
- (3) Edward VI of England
- Elizabeth Tudor (daughter of Henry VII)|Elizabeth Tudor (1492–1495)
- Mary Tudor (queen consort of France)|Mary, Queen of France (1496–1533)
- Henry Brandon (1516–1522)
- Frances Grey, Duchess of Suffolk (1517–1547)
- (4) Lady Jane Grey (1536–1553)
- Lady Catherine Grey|Catherine Seymour, Countess of Hertford (1540–1568)
- Lady Mary Grey|Lady Mary Keyes (1545–1578)
- Elizabeth Stokes (1555–1556)
- Eleanor Clifford, Countess of Cumberland (1519–1547)
- From whom are descended the Earl of Derby|Earls of Derby
- Henry Brandon, 1st Earl of Lincoln (1523–1534)
- Edmund Tudor, Duke of Somerset (1499–1500)
- Katherine Tudor (1503)|Katherine Tudor (1503–1503)