Template:Football box collapsible: Difference between revisions

From Hattrick
Jump to navigationJump to search
Dalepopp (talk | contribs)
No edit summary
Dalepopp (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
{| cellspacing="0" class="{{{class|mw-collapsible mw-collapsed}}}" style="{{#if:{{{nobars|}}}||border-top:1px solid #999999; border-bottom:1px solid #999999; margin-bottom:-1px;}} width:{{{size|100%}}}; background-color:{{Football box collapsible/result/{{{competition|default}}}|result={{{result|}}}|bg={{{bg|}}}}}"
{| cellspacing="0" class="{{{class|mw-collapsible mw-collapsed}}}" style="{{#if:{{{nobars|}}}||border-top:1px solid #999999; border-bottom:1px solid #999999; margin-bottom:-1px;}} width:{{{size|100%}}}; background-color:{{Football box collapsible/result/{{{competition|default}}}|result={{{result|}}}|bg={{{bg|}}}}}"
|-
|-
| width={{#ifeq:{{{format}}}|1|28%|{{#ifeq:{{{format}}}|1.1|22%|{{#ifeq:{{{format}}}|1.2|28%|19%}}}}}} style="vertical-align:top" | <span style="white-space:nowrap;float:right;margin-left:.5em">{{{date}}}</span> {{#if:{{{round|}}}|<span style="font-size:85%;">{{{round}}}</span>|}}
| width={{#ifeq:{{{format|}}}|1|28%|{{#ifeq:{{{format|}}}|1.1|22%|{{#ifeq:{{{format|}}}|1.2|28%|19%}}}}}} style="vertical-align:top" | <span style="white-space:nowrap;float:right;margin-left:.5em">{{{date}}}</span> {{#if:{{{round|}}}|<span style="font-size:85%;">{{{round}}}</span>|}}
| width={{#ifeq:{{{format}}}|1|19%|{{#ifeq:{{{format}}}|1.1|25%|{{#ifeq:{{{format}}}|1.2|19%|23%}}}}}} style="text-align:right;vertical-align:top" class="vcard attendee" | '''<span class="fn org">{{{team1}}}</span>'''
| width={{#ifeq:{{{format|}}}|1|19%|{{#ifeq:{{{format|}}}|1.1|25%|{{#ifeq:{{{format|}}}|1.2|19%|23%}}}}}} style="text-align:right;vertical-align:top" class="vcard attendee" | '''<span class="fn org">{{{team1}}}</span>'''
| width={{#ifeq:{{{format}}}|1|8%|{{#ifeq:{{{format}}}|1.1|8%|{{#ifeq:{{{format}}}|1.2|8%|12%}}}}}} style="text-align:center;vertical-align:top" | <span style="white-space:nowrap;display:inline;">'''{{#if:{{{score|}}}|{{{score}}}|v}}'''{{#if:{{{aet|}}}|<span style="font-size:85%"> ([[Overtime (sports)#Association football|a.e.t.]])</span>}}</span>{{#if:{{{aggregatescore|}}}|<br><span style="font-size:85%">('''{{{aggregatescore}}}''' [[Playoff format#Total points series (aggregate)|agg.]])</span>|}}{{#if:{{{penaltyscore|}}}|<br><span style="font-size:85%">('''{{{penaltyscore}}}''' [[Penalty shoot-out (association football)|p]])</span>|}}
| width={{#ifeq:{{{format|}}}|1|8%|{{#ifeq:{{{format|}}}|1.1|8%|{{#ifeq:{{{format|}}}|1.2|8%|12%}}}}}} style="text-align:center;vertical-align:top" | <span style="white-space:nowrap;display:inline;">'''{{#if:{{{score|}}}|{{{score}}}|v}}'''{{#if:{{{aet|}}}|<span style="font-size:85%"> ([[Overtime (sports)#Association football|a.e.t.]])</span>}}</span>{{#if:{{{aggregatescore|}}}|<br><span style="font-size:85%">('''{{{aggregatescore}}}''' [[Playoff format#Total points series (aggregate)|agg.]])</span>|}}{{#if:{{{penaltyscore|}}}|<br><span style="font-size:85%">('''{{{penaltyscore}}}''' [[Penalty shoot-out (association football)|p]])</span>|}}
| width={{#ifeq:{{{format}}}|1|19%|{{#ifeq:{{{format}}}|1.1|19%|{{#ifeq:{{{format}}}|1.2|26%|23%}}}}}} style="vertical-align:top" class="vcard attendee" | '''<span class="fn org">{{{team2}}}</span>'''
| width={{#ifeq:{{{format|}}}|1|19%|{{#ifeq:{{{format|}}}|1.1|19%|{{#ifeq:{{{format|}}}|1.2|26%|23%}}}}}} style="vertical-align:top" class="vcard attendee" | '''<span class="fn org">{{{team2}}}</span>'''
! width={{#ifeq:{{{format}}}|1|26%|{{#ifeq:{{{format}}}|1.1|26%|{{#ifeq:{{{format}}}|1.2|19%|23%}}}}}} style="text-align:left;vertical-align:top;font-weight:normal" | {{#if:{{{location|}}}|<span style="font-size:85%;">{{{location}}}</span>|<span class="location" style="font-size:85%;">{{{stadium}}}</span>}}
! width={{#ifeq:{{{format|}}}|1|26%|{{#ifeq:{{{format|}}}|1.1|26%|{{#ifeq:{{{format|}}}|1.2|19%|23%}}}}}} style="text-align:left;vertical-align:top;font-weight:normal" | {{#if:{{{location|}}}|<span style="font-size:85%;">{{{location}}}</span>|<span class="location" style="font-size:85%;">{{{stadium}}}</span>}}
|- style="font-size:85%"
|- style="font-size:85%"
| style="vertical-align:top;text-align:right;" | {{{time|}}}
| style="vertical-align:top;text-align:right;" | {{{time|}}}
| style="vertical-align:top;text-align:right;" | {{#if:{{{events1|}}}|{{#ifeq:{{str_sub|{{{events1}}}|0|1}}|*|{{plainlist|{{{events1}}}}}|{{{events1}}}}}|{{#ifeq:{{str_sub|{{{goals1|}}}|0|1}}|*|{{plainlist|{{{goals1}}}}}|{{{goals1|}}}}}}}
| style="vertical-align:top;text-align:right;" | {{#if:{{{events1|}}}|{{{events1}}}|{{{goals1|}}}}}
| style="vertical-align:top;text-align:center;" | {{#ifeq:{{str_sub|{{{report|}}}|0|4}}|http|[{{{report}}} {{{reportlabel|Match report}}}]|{{{report|}}}}}
| style="vertical-align:top;text-align:center;" | {{#if:{{{report|}}}|[{{{report}}} {{{reportlabel|Match report}}}]|}}
| style="vertical-align:top;" | {{#if:{{{events2|}}}|{{#ifeq:{{str_sub|{{{events2}}}|0|1}}|*|{{plainlist|{{{events2}}}}}|{{{events2}}}}}|{{#ifeq:{{str_sub|{{{goals2|}}}|0|1}}|*|{{plainlist|{{{goals2}}}}}|{{{goals2|}}}}}}}
| style="vertical-align:top;" | {{#if:{{{events2|}}}|{{{events2}}}|{{{goals2|}}}}}
| style="vertical-align:top;" | {{#if:{{{location|}}}|{{#if:{{{stadium|}}}|Stadium: <span class="location">{{{stadium}}}</span><br>|}}}}{{#if:{{{attendance|}}}|Attendance: {{{attendance}}}<br>|}}{{#if:{{{referee|}}}|Referee: {{{referee}}}<br>|}}{{#if:{{{assistantreferees|}}}|Assistant referees: {{{assistantreferees}}}<br>|}}{{#if:{{{assistantreferee2|}}}|<span style="visibility:hidden">Assistant referees: </span>{{{assistantreferee2}}}<br>|}}{{#if:{{{fourthofficial|}}}|Fourth official: {{{fourthofficial}}}<br>|}}{{#if:{{{fifthofficial|}}}|Fifth official: {{{fifthofficial}}}<br>|}}{{#if:{{{goallineassistants|}}}|Goal-line assistants: {{{goallineassistants}}}|}}{{#if:{{{goallineassistant2|}}}|<span style="visibility:hidden">Goal-line assistants: </span>{{{goallineassistant2}}}|}}{{#if:{{{motm|}}}|Man of the Match: {{{motm}}}<br>|}}{{#if:{{{mvp|}}}|MVP: {{{mvp}}}|}}
| style="vertical-align:top;" | {{#if:{{{location|}}}|{{#if:{{{stadium|}}}|Stadium: <span class="location">{{{stadium}}}</span><br>|}}}}{{#if:{{{attendance|}}}|Attendance: {{{attendance}}}<br>|}}{{#if:{{{referee|}}}|Referee: {{{referee}}}<br>|}}{{#if:{{{assistantreferees|}}}|Assistant referees: {{{assistantreferees}}}<br>|}}{{#if:{{{assistantreferee2|}}}|<span style="visibility:hidden">Assistant referees: </span>{{{assistantreferee2}}}<br>|}}{{#if:{{{fourthofficial|}}}|Fourth official: {{{fourthofficial}}}<br>|}}{{#if:{{{fifthofficial|}}}|Fifth official: {{{fifthofficial}}}<br>|}}{{#if:{{{goallineassistants|}}}|Goal-line assistants: {{{goallineassistants}}}|}}{{#if:{{{goallineassistant2|}}}|<span style="visibility:hidden">Goal-line assistants: </span>{{{goallineassistant2}}}|}}{{#if:{{{motm|}}}|Man of the Match: {{{motm}}}<br>|}}{{#if:{{{mvp|}}}|MVP: {{{mvp}}}|}}
| style="display:none" | <!-- fix for empty line -->
| style="display:none" | <!-- fix for empty line -->
Line 20: Line 20:
{{!}} style="text-align:center;" {{!}} '''[[Penalty shoot-out (association football){{!}}Penalties]]'''
{{!}} style="text-align:center;" {{!}} '''[[Penalty shoot-out (association football){{!}}Penalties]]'''
{{!}}- style="font-size:85%"
{{!}}- style="font-size:85%"
{{!}} style="text-align:right;vertical-align:top;" {{!}} {{#ifeq:{{str_sub|{{{penalties1}}}|0|1}}|*|{{plainlist|{{{penalties1}}}}}|{{{penalties1|}}}}}
{{!}} style="text-align:right;vertical-align:top;" {{!}} {{{penalties1|}}}
{{!}} &nbsp;
{{!}} &nbsp;
{{!}} style="vertical-align:top;" {{!}} {{#ifeq:{{str_sub|{{{penalties2}}}|0|1}}|*|{{plainlist|{{{penalties2}}}}}|{{{penalties2|}}}}}
{{!}} style="vertical-align:top;" {{!}} {{{penalties2|}}}
|}}
|}}
{{#ifexpr:{{#if:{{{note|}}}|1|0}} or {{#if:{{{seealso|}}}|1|0}} |
{{#ifexpr:{{#if:{{{note|}}}|1|0}} or {{#if:{{{seealso|}}}|1|0}} |
Line 31: Line 31:
|}}
|}}
|}</div></includeonly><noinclude>
|}</div></includeonly><noinclude>
== Usage ==
== Usage ==


This template creates a collapsible football match box. The result can be shown by background color using the <code>result</code> parameter.
This template creates a collapsible football match box.
 
The <code>result</code> parameter controls the background color of the match box. The result is entered from the perspective of the club whose season page is being displayed.


For match events, <code>events1</code> and <code>events2</code> are preferred. The older <code>goals1</code> and <code>goals2</code> parameters remain supported for compatibility with existing pages.
For match events, <code>events1</code> and <code>events2</code> are preferred. The older <code>goals1</code> and <code>goals2</code> parameters remain supported for compatibility with existing pages.


A raw URL entered in <code>report</code> is automatically displayed as '''Match report'''. A different label may be specified with <code>reportlabel</code>.
Enter the match-report URL directly in <code>report</code>. The template displays the link as '''Match report'''. A different label can be specified using <code>reportlabel</code>.


=== Copy/paste ===
=== Copy/paste ===
Line 50: Line 53:
| team2 =
| team2 =
| events1 =
| events1 =
*
| report =
| report =
| events2 =
| events2 =
*
| stadium =
| stadium =
| attendance =
| attendance =
Line 66: Line 67:
Unused parameters may be left blank or removed.
Unused parameters may be left blank or removed.


For <code>result</code>, use:
=== Results ===


* <code>W</code> = win
Use:
* <code>D</code> = draw
* <code>L</code> = loss


The result is from the perspective of the club whose season page is being displayed, not necessarily <code>team1</code>.
* <code>W</code> = Win
* <code>D</code> = Draw
* <code>L</code> = Loss
 
The result is from the perspective of the club whose season page is being displayed, regardless of whether that club is <code>team1</code> or <code>team2</code>.


=== Match events ===
=== Match events ===


Events should be listed chronologically under the appropriate team.
Use <code>&lt;br&gt;</code> to separate multiple events.


Common event templates include:
Examples:


<pre>
<pre>
* Player Name {{goal|54}}
| events1 = Player Name {{goal|54}}<br>
* Player Name {{goal|54|pen.}}
Player Name {{goal|54|pen.}}<br>
* Player Name {{yel|33}}
Player Name {{yel|63}}<br>
* Player Name {{sent off|0|86}}
Player Name {{sent off|0|86}}
</pre>
</pre>


Additional event templates or inline images may also be used in <code>events1</code> and <code>events2</code>.
Events should normally be listed chronologically.
 
Additional event templates or inline images may be used as needed.
 
=== Match report ===
 
Enter only the URL:
 
<pre>
| report = https://www.hattrick.org/Club/Matches/Match.aspx?matchID=700538146&SourceSystem=Hattrick
</pre>
 
The link will display as '''Match report'''.
 
To use another label:
 
<pre>
| reportlabel = Report
</pre>


=== Example ===
=== Example ===
Line 99: Line 120:
| score = 1–1
| score = 1–1
| team2 = [[Hourmen]]
| team2 = [[Hourmen]]
| events1 =
| events1 = Matthew Dozier {{yel|33}}<br>
* Matthew Dozier {{yel|33}}
Phil Roof {{goal|54|pen.}}
* Phil Roof {{goal|54|pen.}}
| report = https://www.hattrick.org/Club/Matches/Match.aspx?matchID=700538146&SourceSystem=Hattrick
| report = https://www.hattrick.org/Club/Matches/Match.aspx?matchID=700538146&SourceSystem=Hattrick
| events2 =
| events2 = Augusto Botero {{goal|39}}
* Augusto Botero {{goal|39}}
| stadium = Dudley Field
| stadium = Dudley Field
| attendance = 7,308
| attendance = 7,308
Line 119: Line 138:
| score = 1–1
| score = 1–1
| team2 = [[Hourmen]]
| team2 = [[Hourmen]]
| events1 =
| events1 = Matthew Dozier {{yel|33}}<br>
* Matthew Dozier {{yel|33}}
Phil Roof {{goal|54|pen.}}
* Phil Roof {{goal|54|pen.}}
| report = https://www.hattrick.org/Club/Matches/Match.aspx?matchID=700538146&SourceSystem=Hattrick
| report = https://www.hattrick.org/Club/Matches/Match.aspx?matchID=700538146&SourceSystem=Hattrick
| events2 =
| events2 = Augusto Botero {{goal|39}}
* Augusto Botero {{goal|39}}
| stadium = Dudley Field
| stadium = Dudley Field
| attendance = 7,308
| attendance = 7,308

Latest revision as of 08:40, 18 August 2026


Usage

This template creates a collapsible football match box.

The result parameter controls the background color of the match box. The result is entered from the perspective of the club whose season page is being displayed.

For match events, events1 and events2 are preferred. The older goals1 and goals2 parameters remain supported for compatibility with existing pages.

Enter the match-report URL directly in report. The template displays the link as Match report. A different label can be specified using reportlabel.

Copy/paste

{{Football box collapsible
| round =
| date =
| time =
| team1 =
| score =
| team2 =
| events1 =
| report =
| events2 =
| stadium =
| attendance =
| referee =
| assistantreferees =
| motm =
| result =
| competition = default
}}

Unused parameters may be left blank or removed.

Results

Use:

  • W = Win
  • D = Draw
  • L = Loss

The result is from the perspective of the club whose season page is being displayed, regardless of whether that club is team1 or team2.

Match events

Use <br> to separate multiple events.

Examples:

| events1 = Player Name {{goal|54}}<br>
Player Name {{goal|54|pen.}}<br>
Player Name {{yel|63}}<br>
Player Name {{sent off|0|86}}

Events should normally be listed chronologically.

Additional event templates or inline images may be used as needed.

Match report

Enter only the URL:

| report = https://www.hattrick.org/Club/Matches/Match.aspx?matchID=700538146&SourceSystem=Hattrick

The link will display as Match report.

To use another label:

| reportlabel = Report

Example

{{Football box collapsible
| round = Week 3
| date = 14 August 2022
| time = 18:00
| team1 = [[Nashville FC]]
| score = 1–1
| team2 = [[Hourmen]]
| events1 = Matthew Dozier {{yel|33}}<br>
Phil Roof {{goal|54|pen.}}
| report = https://www.hattrick.org/Club/Matches/Match.aspx?matchID=700538146&SourceSystem=Hattrick
| events2 = Augusto Botero {{goal|39}}
| stadium = Dudley Field
| attendance = 7,308
| result = D
| competition = default
}}
14 August 2022 Week 3 Nashville FC 1–1 Hourmen Dudley Field
18:00 Matthew Dozier Booked in the 33rd minute 33'

Phil Roof  Goal  54' (pen.)

Match report Augusto Botero  Goal  39' Attendance: 7,308