User:DLManiac/Template:Tournament table templates/doc
This is a documentation subpage for User:DLManiac/Template:Tournament table templates. It may contain usage information, categories and other content that is not part of the original user template page. |
The templates in the series are intended for use in tournament performance tables for articles such as darts, snooker, and tennis players. For an example, see Phil Taylor career statistics#Performance timeline. These come in 2 varieties, cell templates for use in individual cells of the table, and legends to unify the tables across Wikipedia.
For example, {{TournW}}
makes a cell with a green background and bold W. The optional link in the cell is taken from the first parameter; and the option to change text comes from the second parameter. So {{TournW|link}}
and {{TournW|link|new text}}
are also options. The intention is generally that the first parameter is the link to that specific edition of the tournament, with no "[[" required.
If you want to use other attributes for the table cells, e.g. colspan
or rowspan
, they need to be put before the template call and there must be no vertical bar |
in between them:
W | RU | N/A |
---|---|---|
Last 32 |
... !{{TournW}} |{{TournRU}} |rowspan=2 {{TournNA}} |- |colspan=2 {{TournLR||Last 32}} ...
Templates
[edit]Default syntax | Preview (default) | With link | Preview (link) | With link and text | Preview (link & text) | With text, no link | Preview (text) |
---|---|---|---|---|---|---|---|
{{TournW}} | W | {{TournW|2010 UK Open}} | W | {{TournW|2010 UK Open|Won}} | Won | {{TournW|Winner}} | Winner |
{{TournRU}} | RU | {{TournRU|2010 UK Open}} | RU | {{TournRU|2010 UK Open|F}} | F | {{TournRU|2nd}} | 2nd |
{{TournSF}} | SF | {{TournSF|2010 UK Open}} | SF | {{TournSF|2010 UK Open|Top 4}} | Top 4 | {{TournSF|3rd}} | 3rd |
{{TournQF}} | QF | {{TournQF|2010 UK Open}} | QF | {{TournQF|2010 UK Open|Top 8}} | Top 8 | {{TournQF|7th}} | 7th |
{{TournLR}} | RR | {{TournLR|2010 UK Open}} | RR | {{TournLR|2010 UK Open|2R}} | 2R | {{TournLR|Last 32}} | Last 32 |
{{TournDQ}} | DQ | {{TournDQ|2010 UK Open}} | DQ | {{TournDQ|2010 UK Open|Banned}} | Banned | {{TournDQ|Barred}} | Barred |
Default syntax | Preview (default) | Other text | Preview (other text) | With no text | Preview (notext) | ||
{{TournNA}} | N/A | {{TournNA|Did not play}} | Did not play | {{TournNA}} |
Also, for a legend that can be used on most pages containing these cell templates
{{TournLegend}}
generates the following table:
Performance Table Legend | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
W | Won the tournament | RU | Runner-up | SF | Semifinalist | QF | Quarterfinalist | #R RR L# |
Lost in # round Round-robin Last # stage |
DQ | Disqualified |
DNQ | Did not qualify | DNP | Did not participate | WD | Withdrew | NH | Tournament not held | NYF | Not yet founded |
Code
[edit]Common code to most if not all the templates in this series:
|style="background: #abcdef; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}" class="table-tournament"| {{#if:{{{1|}}} | {{#if:{{{2|}}} |[[{{{1|}}}|{{{2|}}}]] | [[{{{1|}}}|XX]] }} | {{{2|XX}}} }}