Template:Fb r: Difference between revisions
Created page with '<!-- if r equals "null" -->|{{#ifeq:{{{r}}}|null<!-- then set background color -->|bgcolor=#CCCCCC…' |
No edit summary |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
<!-- | <!-- | ||
if r equals "null" -->|{{#ifeq:{{{r}}}|null<!-- | if r equals "null" -->|{{#ifeq:{{{r}}}|null<!-- | ||
then set background color -->| | then set background color -->|style="background-color:#BBBBBB"{{!}}<!-- | ||
else if gf is not empty (set background color) -->|{{#if:{{{gf|}}}<!-- | else if gf is not empty (set background color) -->|{{#if:{{{gf|}}}<!-- | ||
if home team wins -->|{{#ifexpr:{{{gf}}}-{{{ga}}}>0<!-- | if home team wins -->|{{#ifexpr:{{{gf}}}-{{{ga}}}>0<!-- | ||
then if there is an overtime win -->|{{#ifeq:{{{r}}}|ot<!-- | then if there is an overtime win -->|{{#ifeq:{{{r}}}|ot<!-- | ||
set background color for OT win -->| | set background color for OT win -->|style="background-color:#CCF9FF"{{!}}<!-- | ||
else set standard background color -->| | else set standard background color -->|style="background-color:#BBF3FF"{{!}}<!-- | ||
endif -->}}<!-- | endif -->}}<!-- | ||
else if away team wins -->|{{#ifexpr:{{{gf}}}-{{{ga}}}<0<!-- | else if away team wins -->|{{#ifexpr:{{{gf}}}-{{{ga}}}<0<!-- | ||
then if there is an overtime win -->|{{#ifeq:{{{r}}}|ot<!-- | then if there is an overtime win -->|{{#ifeq:{{{r}}}|ot<!-- | ||
set background color for OT loss -->| | set background color for OT loss -->|style="background-color:#FFCCCC"{{!}}<!-- | ||
else set standard background color -->| | else set standard background color -->|style="background-color:#FFBBBB"{{!}}<!-- | ||
endif -->}}<!-- | endif -->}}<!-- | ||
else if there are PK's after the draw -->|{{#ifeq:{{{r}}}|pk<!-- | else if there are PK's after the draw -->|{{#ifeq:{{{r}}}|pk<!-- | ||
if home team wins on PK's -->|{{#ifexpr:{{{pf}}}-{{{pa}}}>0<!-- | if home team wins on PK's -->|{{#ifexpr:{{{pf}}}-{{{pa}}}>0<!-- | ||
set background color for PK win -->| | set background color for PK win -->|style="background-color:#DDFCFF"{{!}}<!-- | ||
else set bg color for PK loss -->| | else set bg color for PK loss -->|style="background-color:#FFDDDD"{{!}}<!-- | ||
when no PK's happened (endif) -->}}<!-- | when no PK's happened (endif) -->}}<!-- | ||
set background color for a draw -->| | set background color for a draw -->|style="background-color:#FFFFBB"{{!}}<!-- | ||
endif -->}}<!-- | endif -->}}<!-- | ||
endif -->}}<!-- | endif -->}}<!-- | ||
| Line 24: | Line 24: | ||
endif -->}}<!-- | endif -->}}<!-- | ||
if ma in not null -->{{#if:{{{ma|}}}<!-- | if ma in not null -->{{#if:{{{ma|}}}<!-- | ||
then "[[ma|" -->|{{ | then "[[ma|" -->|{{!((}}{{{ma}}}{{!}}<!-- | ||
endif -->}}<!-- | endif -->}}<!-- | ||
if gf is not null -->{{#if:{{{gf|}}}<!-- | if gf is not null -->{{#if:{{{gf|}}}<!-- | ||
then gf-ga (with less leading in case OT or PK) -->|<span style="line-height: 80%">{{{gf}}}–{{{ga}}}</span><!-- | then gf-ga (with less leading in case OT or PK) -->|<span class="nowrap" style="line-height: 80%">{{{gf}}}–{{{ga}}}</span><!-- | ||
else if ma is not null: "a" -->|{{#if:{{{ma|}}}|a}}<!-- | else if ma is not null: "a" -->|{{#if:{{{ma|}}}|a}}<!-- | ||
endif -->}}<!-- | endif -->}}<!-- | ||
if ma is not null then "]]" -->{{#if:{{{ma|}}}|{{ | if ma is not null then "]]" -->{{#if:{{{ma|}}}|{{))!}}}}<!-- | ||
if nt is not null: display nt -->{{#if:{{{nt|}}}|<sup>{{{nt}}}</sup>}}<!-- | if nt is not null: display nt -->{{#if:{{{nt|}}}|<sup>{{{nt}}}</sup>}}<!-- | ||
if match was decided after 90 minutes -->{{#switch:{{{r}}}<!-- | if match was decided after 90 minutes -->{{#switch:{{{r}}}<!-- | ||
| Line 39: | Line 39: | ||
--><noinclude> | --><noinclude> | ||
{{ | {{documentation}}<!-- Add categories to the /doc subpage, not here! --> | ||
<!-- Add categories | [[Category:Fb templates]]</noinclude> | ||
</noinclude> | |||
Latest revision as of 23:38, 11 January 2020
|
{{Fb r}} (football result) exists to simplify the creation of results tables such as Premier_League_2007-08#Results. It should be used together with Template:Tl2, Template:Tl2 and Template:Tl2.
Parameters
Template:TemplateDataHeader <templatedata> { "params": { "r": { "label": "Modifier", "description": "This parameter takes three values. \"null\" grays out the cell, such as the invalid cell for a team playing itself. \"ot\" indicates that the match ended in overtime. \"pk\" indicates that the match was resolved by penalty kick-out.", "type": "string", "suggested": true }, "gf": { "label": "Goals for home team", "description": "Required unless modifier (r) is null.", "type": "number", "suggested": true }, "ga": { "label": "Goals against home team", "description": "Required unless modifier (r) is null.", "type": "number", "suggested": true }, "pf": { "label": "Penalties for home team", "description": "Requires modifier (r) to be \"pk\"", "type": "number", "suggested": true }, "pa": { "label": "Penalties against home team", "description": "Requires modifier (r) to be \"pk\"", "type": "number", "suggested": true }, "ma": { "label": "Match article", "description": "The title of an article about the match. Clicking the score in the cell will take you to this page.", "type": "wiki-page-name", "suggested": true }, "nt": { "label": "Footnote number", "description": "A number to refer to a footnote in the table footer. Note that a note numbered 1 already exists so these notes must start from 2.", "type": "number" } }, "description": "Creates a single cell in a football results table. Intended to be used with Fb r header, Fb r team, and Fb r footer. See this template's page for a demonstration.\n\n", "format": "inline" } </templatedata>
Articles using it
To see examples of articles using this template, click here.
Examples
Code:
{{fb r header |nt=12 |ABL |ABL |ABL |ABL |ABL |ABL |ABL |ABL |ABL |ABL |ABL |ABL }}
{{fb r team |t=ABL}}
<!-- Arsenal -->{{Fb r |r=null }}
<!-- Aston Villa -->{{Fb r }}
<!-- Birmingham -->{{Fb r |gf=2 |ga=1 }}
<!-- Blackburn -->{{Fb r |gf=4 |ga=1 |r=ot }}
<!-- Bolton -->{{Fb r |gf=1 |ga=1 |r=pk |pf=4 |pa=2 |ma=West London derby }}
<!-- Chelsea -->{{Fb r |gf=4 |ga=4 }}
<!-- Derby County -->{{Fb r |gf=2 |ga=2 |r=pk |pf=3 |pa=5 }}
<!-- Everton -->{{Fb r |gf=1 |ga=3 |r=ot }}
<!-- Fulham -->{{Fb r |gf=0 |ga=2 }}
<!-- Liverpool -->{{Fb r |ma=West London derby }}
{{fb r footer |u=14 August |s= |a=yes}}
Result:
| Home ╲ Away | ABL | ABL | ABL | ABL | ABL | ABL | ABL | ABL | ABL | ABL | ABL | ABL |
| ABL | 2–1 | 4–1 OT |
1–1 4 PK 2 |
4–4 | 2–2 3 PK 5 |
1–3 OT |
0–2 | a |
1 ^The home team is listed in the left-hand column.
Colours: Blue = home team win; Yellow = draw; Red = away team win.
For coming matches, an a indicates there is an article about the match.
| The above documentation is transcluded from Template:Fb r/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |