Template:MATCHBOX Infobox style/doc: Difference between revisions

From ytptenniswiki
Jump to navigation Jump to search
en>Tom.Reding
m →‎top: {{High-use}}
 
deprecation warning
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{High-use}}
 
{{Lua|Module:WPMILHIST Infobox style|Module:Data}}
'''<big><big><big>THIS IS DEPRECATED! USE [[Template:MatchboxV2|THIS]] INSTEAD.</big></big></big>'''
{| {{WPMILHIST Infobox style|main_box}}
 
{{Lua|Module:MATCHBOX Infobox style|Module:Data}}
{| {{MATCHBOX Infobox style|main_box}}
|-
|-
! colspan="2" {{WPMILHIST Infobox style|header_bar}} | Title
! colspan="2" {{MATCHBOX Infobox style|header_bar}} | MATCH NAME
|-
|-
| colspan="2" {{WPMILHIST Infobox style|sub_header_bar}} | Subtitle
| colspan="2" {{MATCHBOX Infobox style|sub_header_bar}} | (type of match, if applicable)
|-
|-
| colspan="2" {{WPMILHIST Infobox style|image_box}} | [[File:Bad Title Example.png|200px]] <br/> This is a caption.
| colspan="2" {{MATCHBOX Infobox style|image_box}} | [[File:Campers.png|200px]] <br/> "''(quote from the match, etc.)''"
|-
|-
! style="padding-right: 1em;" | Label
! style="padding-right: 1em;" | Start Date
| Field contents
| November 9th, 1900
|-  
|-  
! style="padding-right: 1em;" | Second label
! style="padding-right: 1em;" | End Date
| First term,<br/> Second term,<br/> Third term
| April 4th, 2000
|-
|-
! colspan="2" {{WPMILHIST Infobox style|header_bar}} | Secondary header
! style="padding-right: 1em;" | Rounds
| 6
|-
|-
| style="width:50%;"| Lorem ipsum dolor sit amet consectetur adipisicing elit
! style="padding-right: 1em;" | Participants
| style="width:50%; padding-left: 0.25em; border-left: {{WPMILHIST Infobox style|internal_border}}" | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
| ''player1, player2, etc.''
|-
|-
| colspan="2" style="text-align: center; border-top: {{WPMILHIST Infobox style|section_border}}" | ''Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.''
<!--- if the match page is not known, replace with MissingMatchPage template! --->
! style="padding-right: 1em;" | Match Page
| <!-- {{MissingMatchPage}} -->  [https://example.com/ link]
<!--- the following can be deleted if this isn't a tournament match --->
|-
|-
! colspan="2" {{WPMILHIST Infobox style|header_bar}} | Final header
! colspan="2" {{MATCHBOX Infobox style|header_bar}} | Winner (if applicable)
|-
|-
| colspan="2" {{WPMILHIST Infobox style|image_box_plain}} | [[File:Bad Title Example.png|200px]] <br/> This is another caption.
| colspan="2" {{MATCHBOX Infobox style|image_box_plain}} | (Winner)
|}
|}
The [[Wikipedia:Manual of Style/Military history#Infobox templates|various primary and auxiliary infobox templates]] and [[Wikipedia:Manual of Style/Military history#Navigation templates|navigation templates]] maintained by the Military history WikiProject are all coded to use a common set of styling characteristics.  This is needed primarily because a number of the templates are designed to be stacked together to present the appearance of a continuous block; it is also beneficial for providing a consistent appearance to the entire set of articles within our scope.


The style is controlled by the {{tl|WPMILHIST Infobox style}} template, which generates a number of different codes based on the parameter passed to it.
The "Match Box", derived from Wikipedia's Military History Infobox.


* '''<code><nowiki>{{WPMILHIST Infobox style|main_box}}</nowiki></code>''' – produces the CSS <code>class</code> and <code>style</code> parameters for an infobox at a width of 315 [[pixels]].
'''COPY THIS CODE INTO YOUR PAGE:'''
* '''<code><nowiki>{{WPMILHIST Infobox style|main_box_raw}}</nowiki></code>''' – produces the raw CSS <code>style</code> parameters for an infobox at a width of 315 pixels.
<pre>{| {{MATCHBOX Infobox style|main_box}}
* '''<code><nowiki>{{WPMILHIST Infobox style|main_box_raw_auto_width}}</nowiki></code>''' – produces the raw CSS <code>style</code> parameters for an infobox (same as <code>main_box_raw</code> but without <code>width:315px</code>).
|-
* '''<code><nowiki>{{WPMILHIST Infobox style|header_bar}}</nowiki></code>''' – produces the CSS <code>style</code> parameters for a horizontal header bar in an infobox.
! colspan="2" {{MATCHBOX Infobox style|header_bar}} | MATCH NAME
* '''<code><nowiki>{{WPMILHIST Infobox style|header_raw}}</nowiki></code>''' – produces the raw CSS <code>style</code> parameters for a horizontal header bar in an infobox.
|-
* '''<code><nowiki>{{WPMILHIST Infobox style|header_color}}</nowiki></code>''' – produces the raw CSS <code>style</code> color attributes for a horizontal header bar in an infobox.
| colspan="2" {{MATCHBOX Infobox style|sub_header_bar}} | (type of match, if applicable)
* '''<code><nowiki>{{WPMILHIST Infobox style|sub_header_bar}}</nowiki></code>''' – produces the CSS <code>style</code> parameters for a horizontal sub-header bar in an infobox.
|-
* '''<code><nowiki>{{WPMILHIST Infobox style|sub_header_raw}}</nowiki></code>''' – produces the raw CSS <code>style</code> parameters for a horizontal sub-header bar in an infobox.
| colspan="2" {{MATCHBOX Infobox style|image_box}} | [[File:Campers.png|200px]] <br/> "''(quote from the match, etc.)''"
* '''<code><nowiki>{{WPMILHIST Infobox style|image_box}}</nowiki></code>''' – produces the CSS <code>style</code> parameters for a standard image & caption block with a bottom border.
|-
* '''<code><nowiki>{{WPMILHIST Infobox style|image_box_raw}}</nowiki></code>''' – produces the raw CSS <code>style</code> parameters for a standard image & caption block with a bottom border.
! style="padding-right: 1em;" | Start Date
* '''<code><nowiki>{{WPMILHIST Infobox style|image_box_plain}}</nowiki></code>''' – produces the CSS <code>style</code> parameters for a standard image & caption block ''without'' a bottom border; this is typically used when the image block is placed immediately above a header bar, or at the bottom of the infobox.
| November 9th, 1900
* '''<code><nowiki>{{WPMILHIST Infobox style|image_box_plain_raw}}</nowiki></code>''' – produces the raw CSS <code>style</code> parameters for a standard image & caption block ''without'' a bottom border; this is typically used when the image block is placed immediately above a header bar, or at the bottom of the infobox.
|-
* '''<code><nowiki>{{WPMILHIST Infobox style|internal_border}}</nowiki></code>''' – produces the raw CSS <code>style</code> attributes for a border between parts of the same infobox section.
! style="padding-right: 1em;" | End Date
* '''<code><nowiki>{{WPMILHIST Infobox style|section_border}}</nowiki></code>''' – produces the raw CSS <code>style</code> attributes for a border between different infobox sections.
| April 4th, 2000
* '''<code><nowiki>{{WPMILHIST Infobox style|nav_box}}</nowiki></code>''' – produces the raw CSS <code>style</code> attributes for a collapsible navigation template at a width of 315 [[pixels]].
|-
* '''<code><nowiki>{{WPMILHIST Infobox style|nav_box_child}}</nowiki></code>''' – produces the raw CSS <code>style</code> attributes for a collapsible navigation template (same as <code>nav_box</code> but at a width of 305 pixels and without <code>margin-left:1em</code>).
! style="padding-right: 1em;" | Rounds
* '''<code><nowiki>{{WPMILHIST Infobox style|nav_box_wide}}</nowiki></code>''' – produces the raw CSS <code>style</code> attributes for a full-width collapsible navigation template.
| 6
* '''<code><nowiki>{{WPMILHIST Infobox style|nav_box_header}}</nowiki></code>''' – produces the raw CSS <code>style</code> attributes for the header bar in a collapsible navigation template.
|-
*'''<code><nowiki>{{WPMILHIST Infobox style|nav_box_wide_header}}</nowiki></code>''' – produces the raw CSS <code>style</code> attributes for the header bar in a full-width collapsible navigation template.
! style="padding-right: 1em;" | Participants
* '''<code><nowiki>{{WPMILHIST Infobox style|nav_box_label}}</nowiki></code>''' – produces the raw CSS <code>style</code> attributes for a row label in a collapsible navigation template.
| ''player1, player2, etc.''
|-
<!--- if the match page is not known, replace with MissingMatchPage template! --->
! style="padding-right: 1em;" | Match Page
{{MissingMatchPage}} <!-- [https://example.com/ link] -->
<!--- the following can be deleted if this isn't a tournament match --->
|-
! colspan="2" {{MATCHBOX Infobox style|header_bar}} | Winner (if applicable)
|-
| colspan="2" {{MATCHBOX Infobox style|image_box_plain}} | (Winner)
|}</pre>


A sample template using some of these options can be seen at right.  From the top, it includes:
The style is controlled by the {{tl|MATCHBOX Infobox style}} template, which generates a number of different codes based on the parameter passed to it.
# The main <code>header_bar</code> in a table heading cell.
# A <code>sub_header_bar</code> in a normal table cell.
# An <code>image_box</code>.
# Two normal fields with labels.
# A secondary <code>header_bar</code> in a heading cell.
# A pair of cells divided by an <code>internal_border</code>.
# A cell with a <code>section_border</code> at the top.
# Another secondary <code>header_bar</code> in a heading cell.
# An <code>image_box_plain</code>.


More sophisticated samples of the code can be found by examining the actual infoboxes used by the project.<noinclude>
A Matchbox has a space for:
[[Category:WikiProject Military history template instructions| ]]
* the match name
</noinclude><includeonly>{{Sandbox other||
* the type of match
[[Category:WikiProject Military history templates| ]]
* when it was played
}}</includeonly>
* who played in it
* the number of rounds
* a link to the corresponding forum/etc. post of the match
* (in the case of a tournament match) who won.<noinclude>

Latest revision as of 19:23, 6 April 2025

THIS IS DEPRECATED! USE THIS INSTEAD.

MATCH NAME
(type of match, if applicable)

"(quote from the match, etc.)"
Start Date November 9th, 1900
End Date April 4th, 2000
Rounds 6
Participants player1, player2, etc.
Match Page link
Winner (if applicable)
(Winner)

The "Match Box", derived from Wikipedia's Military History Infobox.

COPY THIS CODE INTO YOUR PAGE:

{| {{MATCHBOX Infobox style|main_box}}
|-
! colspan="2" {{MATCHBOX Infobox style|header_bar}} | MATCH NAME
|-
| colspan="2" {{MATCHBOX Infobox style|sub_header_bar}} | (type of match, if applicable)
|-
| colspan="2" {{MATCHBOX Infobox style|image_box}} | [[File:Campers.png|200px]] <br/> "''(quote from the match, etc.)''"
|-
! style="padding-right: 1em;" | Start Date
| November 9th, 1900
|- 
! style="padding-right: 1em;" | End Date
| April 4th, 2000
|-
! style="padding-right: 1em;" | Rounds
| 6
|-
! style="padding-right: 1em;" | Participants
| ''player1, player2, etc.''
|-
<!--- if the match page is not known, replace with MissingMatchPage template! --->
! style="padding-right: 1em;" | Match Page
|  {{MissingMatchPage}} <!-- [https://example.com/ link] -->
<!--- the following can be deleted if this isn't a tournament match --->
|-
! colspan="2" {{MATCHBOX Infobox style|header_bar}} | Winner (if applicable)
|-
| colspan="2" {{MATCHBOX Infobox style|image_box_plain}} | (Winner)
|}

The style is controlled by the {{MATCHBOX Infobox style}} template, which generates a number of different codes based on the parameter passed to it.

A Matchbox has a space for:

  • the match name
  • the type of match
  • when it was played
  • who played in it
  • the number of rounds
  • a link to the corresponding forum/etc. post of the match
  • (in the case of a tournament match) who won.