Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Bracket: Difference between revisions

Template page
No edit summary
No edit summary
Line 1: Line 1:
-- ================================================================
-- ================================================================
-- Template:BracketMatch
-- Template:Bracket
-- Stores one match result into the BracketMatch Cargo table.
-- Main entry point. Invokes Module:Bracket with the chosen format.
-- Place invisibly on tournament pages (inside a display:none div).
-- ================================================================
-- ================================================================


<noinclude>
<noinclude>
{{#cargo_declare:
== Template:Bracket ==
_table    = BracketMatch
Renders a dynamic bracket for team vs team events.
|event      = String
All match data is pulled from Cargo (via BracketMatch template)
|match_id  = String
but can also be overridden with inline parameters.
|team1      = String
 
|team2      = String
=== Usage — GSL (4-team double elim) ===
|score1    = String
<pre>
|score2    = String
{{Bracket
|winner    = String
|format = gsl
|bo        = String
|event  = My Tournament 2026
|match_date = String
|teams  = 4
|casters    = String
|vod        = String
|notes      = String
}}
}}
</pre>


== Template:BracketMatch ==
=== Usage — Single Elimination (8 teams) ===
Invisible data template. Stores a single bracket match result to Cargo.
<pre>
{{Bracket
|format = single
|event  = My Tournament 2026
|teams  = 8
}}
</pre>
 
=== Usage — Double Elimination (8 teams) ===
<pre>
{{Bracket
|format = double
|event  = My Tournament 2026
|teams  = 8
}}
</pre>


=== Usage ===
=== Usage — Round Robin (6 teams) ===
<pre>
<pre>
{{BracketMatch
{{Bracket
  |event   = BGMI Masters Series 2026
|format = rr
  |match_id = UBR1M1
  |event = My Tournament 2026
  |team1   = GodLike Esports
  |teams  = 6
  |team2   = Team SouL
  |team1 = GodLike Esports
  |score1  = 2
  |team2 = Team SouL
  |score2  = 0
  |team3 = OR Esports
|winner  = 1
  |team4 = Team XO
  |bo      = 3
  |team5 = Entity Gaming
  |date    = 2026-03-15 18:00
  |team6 = Blind Esports
  |casters = CasterA, CasterB
  |vod      = https://youtube.com/watch?v=xxx
  |notes    = Played on LAN
}}
}}
</pre>
</pre>


=== Parameters ===
=== Usage — Swiss (8 teams, 5 rounds) ===
* '''event''' — must match the |event= passed to {{Bracket}}
<pre>
* '''match_id''' — format depends on bracket type:
{{Bracket
** Single Elim: R1M1, R2M1 (Round, Match)
|format = swiss
** Double Elim: UBR1M1 (Upper), LBR1M1 (Lower), GF1, GF2
|event  = My Tournament 2026
** GSL: Q1, ELIM, Q2, FINAL
|teams  = 8
** Round Robin: RR1v2, RR1v3 etc. (lower index first)
|rounds = 5
** Swiss: SR1M1, SR2M1 (Swiss Round, Match)
}}
* '''score1 / score2''' — map/game wins (e.g. 2, 1)
</pre>
* '''winner''' — "1" (team1 wins), "2" (team2 wins), or exact team name
* '''bo''' — best-of number (1, 3, 5)
* '''date''' — datetime string (YYYY-MM-DD HH:MM preferred for JS timezone convert)
* '''vod''' — full URL to VOD


=== Batch usage on a tournament page ===
=== Inline override (no Cargo needed) ===
You can pass match data directly as template args (useful for quick pages):
<pre>
<pre>
<div style="display:none">
{{Bracket
{{BracketMatch|event=My Tournament 2026|match_id=Q1|team1=Team A|team2=Team B|score1=2|score2=1|winner=1|bo=3}}
|format      = gsl
{{BracketMatch|event=My Tournament 2026|match_id=ELIM|team1=Team C|team2=Team D|score1=0|score2=2|winner=2|bo=3}}
|event       = My Tournament 2026
{{BracketMatch|event=My Tournament 2026|match_id=Q2|team1=Team B|team2=Team C|score1=2|score2=0|winner=1|bo=3}}
|Q1team1    = GodLike Esports
{{BracketMatch|event=My Tournament 2026|match_id=FINAL|team1=Team A|team2=Team B|score1=3|score2=1|winner=1|bo=5}}
|Q1team2    = Team SouL
</div>
|Q1score1    = 2
|Q1score2    = 1
|Q1win      = 1
|Q1bo        = 3
|ELIMteam1  = OR Esports
|ELIMteam2  = Entity Gaming
|ELIMscore1  = 0
|ELIMscore2  = 2
|ELIMwin    = 2
...
}}
</pre>
</pre>


=== Notes ===
=== Parameters ===
After creating this template, go to Special:CargoTables and recreate
* '''format''' — single / double / gsl / rr / swiss
the BracketMatch table to register the new schema.
* '''event'''  — event name (must match BracketMatch records)
</noinclude><includeonly>{{#cargo_store:
* '''teams'''  — team count (4, 8, 16, 32 for SE/DE; any even for RR/Swiss)
_table    = BracketMatch
* '''rounds''' — (Swiss only) number of rounds, default 5
|event      = {{{event|}}}
* Round name overrides: r1name=, r2name=, ubr1name=, lbr1name=, q1name=, q2name=, elimname=, finalname=
|match_id  = {{{match_id|}}}
 
|team1      = {{{team1|}}}
=== Workflow ===
|team2      = {{{team2|}}}
1. Create tournament page
|score1    = {{{score1|}}}
2. Add hidden BracketMatch templates for each match result
|score2    = {{{score2|}}}
3. Add {{Bracket|format=...|event=...}} wherever you want the bracket displayed
|winner    = {{{winner|}}}
4. As matches are played, update/add BracketMatch entries — bracket updates automatically
|bo        = {{{bo|}}}
 
|match_date = {{{date|}}}
</noinclude><includeonly>{{#invoke:Bracket|main}}</includeonly>
|casters    = {{{casters|}}}
|vod        = {{{vod|}}}
|notes      = {{{notes|}}}
}}</includeonly>

Revision as of 00:13, 20 March 2026

-- ================================================================ -- Template:Bracket -- Main entry point. Invokes Module:Bracket with the chosen format. -- ================================================================


Template:Bracket

Renders a dynamic bracket for team vs team events. All match data is pulled from Cargo (via BracketMatch template) but can also be overridden with inline parameters.

Usage — GSL (4-team double elim)

{{Bracket
 |format = gsl
 |event  = My Tournament 2026
 |teams  = 4
}}

Usage — Single Elimination (8 teams)

{{Bracket
 |format = single
 |event  = My Tournament 2026
 |teams  = 8
}}

Usage — Double Elimination (8 teams)

{{Bracket
 |format = double
 |event  = My Tournament 2026
 |teams  = 8
}}

Usage — Round Robin (6 teams)

{{Bracket
 |format = rr
 |event  = My Tournament 2026
 |teams  = 6
 |team1  = GodLike Esports
 |team2  = Team SouL
 |team3  = OR Esports
 |team4  = Team XO
 |team5  = Entity Gaming
 |team6  = Blind Esports
}}

Usage — Swiss (8 teams, 5 rounds)

{{Bracket
 |format = swiss
 |event  = My Tournament 2026
 |teams  = 8
 |rounds = 5
}}

Inline override (no Cargo needed)

You can pass match data directly as template args (useful for quick pages):

{{Bracket
 |format      = gsl
 |event       = My Tournament 2026
 |Q1team1     = GodLike Esports
 |Q1team2     = Team SouL
 |Q1score1    = 2
 |Q1score2    = 1
 |Q1win       = 1
 |Q1bo        = 3
 |ELIMteam1   = OR Esports
 |ELIMteam2   = Entity Gaming
 |ELIMscore1  = 0
 |ELIMscore2  = 2
 |ELIMwin     = 2
 ...
}}

Parameters

  • format — single / double / gsl / rr / swiss
  • event — event name (must match BracketMatch records)
  • teams — team count (4, 8, 16, 32 for SE/DE; any even for RR/Swiss)
  • rounds — (Swiss only) number of rounds, default 5
  • Round name overrides: r1name=, r2name=, ubr1name=, lbr1name=, q1name=, q2name=, elimname=, finalname=

Workflow

1. Create tournament page 2. Add hidden BracketMatch templates for each match result 3. Add -- ================================================================ -- Template:Bracket -- Main entry point. Invokes Module:Bracket with the chosen format. -- ================================================================

Unknown bracket format: .... Valid: single, double, gsl, rr, swiss

wherever you want the bracket displayed

4. As matches are played, update/add BracketMatch entries — bracket updates automatically