Mô đun:Sports series/tài liệu

This is a module for generating match results for a sports series, such as a thể thức hai lượt. However, the module can support single-leg ties up to an unlimited number of legs. The template supports domestic and international football matches. While designed for association football, it can be used for any sport that features a series between teams.

Cách sử dụng
In its simplest form, only a few parameters are needed to build a table.

Bóng đá cấp câu lạc bộ quốc tế
For two-legged ties in international club football, seven parameters are expected to be passed for each row. This includes each club's name and national association country name/code, the aggregate score and the score of both legs.

Bóng đá cấp đội tuyển quốc gia hoặc câu lạc bộ trong nước
For two-legged ties in national team or domestic club football, five parameters are expected to be passed for each row. This includes each club's name, the aggregate score and the score of both legs. The parameter must be passed to disable the country flag parameter.

Ví dụ

Bóng đá cấp câu lạc bộ quốc tế
; Cách sử dụng

; Đầu ra

Bóng đá cấp câu lạc bộ trong nước
; Cách sử dụng

; Đầu ra

Bóng đá cấp đội tuyển quốc gia
; Cách sử dụng
|3–1||2–0|1–1
||4–3||2–1|2–2
||1–3||1–1|0–2
||1–3||0–1|1–2
}}

; Đầu ra
|3–1||2–0|1–1
||4–3||2–1|2–2
||1–3||1–1|0–2
||1–3||0–1|1–2
}}

Danh sách tham số
Below is a full list of the named parameters for this module. Additionally, the unnamed parameters are used to pass the teams and scores of each of the ties (as shown above). All parameters are optional.

Other features/notes
Please note that in order to display a row in the table, at least one cell of said row must have value that is not empty or whitespace (this includes the note parameters for the aggregate and leg score columns). Otherwise, the module will not create a row for that line and all others below it.

Team country codes
The country codes supplied for each club are by default wrapped into , based on Wikipedia's country data system of templates, and displayed next to each team.

Leg and aggregate scores
For the legs and aggregate scores, all incorrect types of dashes (such as a hyphen, em dash or minus sign) will be converted to an en dash (–). This does not apply to dashes contained in the article title/section anchor portion of wikilinks. These cells will also have nowrap applied to them, as long as two or more sets of parentheses are not present.

In addition, the module will also automatically convert text in brackets (as it relates to how matches were decided) to wikilinks. The following are supported:
(X–Y p), (X–Y pen) or (X–Y pso) (X–Y p)
(aet) or (a.e.t.) (s.h.p.)
(a) or (agr) (k)

; Cách sử dụng

; Đầu ra

Null/nil leg scores
If a cell of one of the leg scores contains only null, the cell will only contain an em dash (—). If , then this em dash will be linked. However, if , then the cell will be left empty and given a background color of .

If a cell of one of the leg scores contains only nil, the cell will not be generated.

These features are useful for rounds of competitions that have an inconsistent number of legs, for example competitions that have a possible replay or play-off match after two legs.

; Cách sử dụng 1 (for null)

; Đầu ra 1 (for null)

; Cách sử dụng 2 (for null, )

; Đầu ra 2 (for null, )

; Cách sử dụng 3 (for nil)
|5–6||3–3|2–2|0–1
||7–1||5–1|2–0|nil
||2–5||1–3|1–2|nil
||2–4||1–1|1–3|nil
}}

; Đầu ra 3 (for nil)
|5–6||3–3|2–2|0–1
||7–1||5–1|2–0|nil
||2–5||1–3|1–2|nil
||2–4||1–1|1–3|nil
}}

Simplified anchor links
Pages utilizing this module often include a wikilink with an anchor to the scores of the legs of a tie, linking to full match summaries.

Typically, when using anchored wikilinks, the page title can be omitted if the anchor appears on the same page. However, such links generally do not function properly when transcluded to other articles.

However, for this module, if any parameter contains an anchored wikilink that omits the page title (for example, 2–2), the module will automatically insert the page title during transclusion to ensure proper linking. For proper functionality, the "sports series" module code must originate from the same page that contains the anchors.

Quasi-parameters

Plus sign (+) for country codes/flag variants
To allow for the use of flag variants, this module supports within the country code parameter the use of a plus sign (+) in between the country name/code and the name of the flag variant.

; Cách sử dụng

; Đầu ra

Three apostrophes () for manual bolding
While the template automatically bolds winning teams (unless ), in some situations the module will be unable to determine the winner. Or, some users may find it undesirable to have the module bold the winner automatically. In these cases, manual bolding can be used to indicate the winning team of a tie. This can be done by placing the three apostrophes before and after the name of the team. If is not disabled, the team that is manually bolded will override the winning team as determined by the module. If is also set, the cell of the team that is manually bolded will also be colored.

This may be used in conjunction with the below method by using five apostrophes on either side of a team to bold and color the cell.

(Note: The usage of three apostrophes was slightly modified for the purposes of this module to bold the cell. Therefore, it is not possible to selectively bold parts of the team parameters, while leaving other parts of said parameter unbolded.)

; Cách sử dụng 1
|5–6||3–3|2–3
||7–1||5–1|2–0
||2–5||1–3|1–2
||2–4||1–1|1–3
}}

; Đầu ra 1
|5–6||3–3|2–3
||7–1||5–1|2–0
||2–5||1–3|1–2
||2–4||1–1|1–3
}}

; Cách sử dụng 2 (third row overrides automatic bolding)
|2–4||1–1|1–3
||5–5 (k)||3–3|2–2
||7–1||5–1|2–0
}}

; Đầu ra 2 (third row overrides automatic bolding)
|2–4||1–1|1–3
||5–5 (k)||3–3|2–2
||7–1||5–1|2–0
}}

Two apostrophes () for manual coloring
While the template allows for automatic coloring of the cells of winning teams via , in some situations (such as matches tied on away goals) the module will be unable to determine the winner. Or, some users may find it undesirable to use to color the winner automatically. In these cases, manual coloring can be used to indicate the winning team of a tie. This can be done by placing the two apostrophes before and after the name of the team. If is set, the cell of team that is manually colored will override the winning team as determined by the module. If is not disabled, the cell of the team that is manually colored will also be bolded.

This may be used in conjunction with the above method by using five apostrophes on either side of a team to color and bold the cell.

Two apostrophes surrounding an aggregate score (or the score of a single-leg tie) can also be used to manually indicate a draw/tie.

(Note: While two apostrophes surrounding both sides of text are usually used to add italics in wikitext, the usage was modified here to allow for a simple way to color the cell. Therefore, it is not possible to italicize team names or aggregate scores using this formatting.)

; Cách sử dụng 1
|5–6|'|3–3|2–3
|'|7–1||5–1|2–0
||2–5|'|1–3|1–2
||2–4|'|1–1|1–3
}}

; Đầu ra 1
|5–6|'|3–3|2–3
|'|7–1||5–1|2–0
||2–5|'|1–3|1–2
||2–4|'|1–1|1–3
}}

; Cách sử dụng 2 (third row overrides automatic coloring)
|2–4||1–1|1–3
||5–5 (k)|'|3–3|2–2
||7–1|'|5–1|2–0
}}

; Đầu ra 2 (third row overrides automatic coloring)
|2–4||1–1|1–3
||5–5 (k)|'|3–3|2–2
||7–1|'|5–1|2–0
}}

; Cách sử dụng 3
|5–6|'
|'|7–1|
||2–2|
}}

; Đầu ra 3
|5–6|'
|'|7–1|
||2–2|
}}

Xem thêm
Mô đun:Sports results
Mô đun:Sports table