Template:Infobox

From HEROsector01
Jump to: navigation, search


Documentation

This template produces an infobox. It can also be used to produce an infobox template.

Parameters

Basic parameters

Parameter Function
class (optional) Additional CSS classes to apply to the infobox. Usually an infobox has the infoLight or the infoDark class (explained below), plus another class that gives it a background image. For example, Template:Rahkshi has the class infoLight, plus the class infoRahkshi that gives it its background image. A complete list of the background image classes is in MediaWiki:Common.css.

Default: nothing

bg_color (optional) The background color of the infobox.

Default: #f9f9f9

fg_color (optional) The foreground color of the infobox. This is the background color of the infobox's "values" (explained further below in the table).

Default: nothing

  • If infoLight class is applied: rgba(255, 255, 255, 0.1)
  • If infoDark class is applied: rgba(27, 42, 52, 0.05)
symbolleft (optional) A symbol to go on the top left of the infobox. For an example see the infobox on Fire (Generation 1).

Default: nothing

symbolright (optional) A symbol to go on the top right of the infobox. For an example see the infobox on Fire (Generation 1).

Default: nothing

name (optional) The name at the top of the infobox.

Default: the name of the current page

prev (optional) A link to some "previous" article (used for articles that are organized chronologically, such as events). For an example see the infobox on Great Cataclysm.

Default: nothing

concurrent (optional) A link to some "concurrent" article (used for articles that are organized chronologically, such as events). For an example see the infobox on Po-Koro Epidemic.

Default: nothing

next (optional) A link to some "next" article (used for articles that are organized chronologically, such as events). For an example see the infobox on Great Cataclysm.

Default: nothing

image (optional) The image in the infobox.

Default: File:Noimage.png

caption (optional) The caption beneath the image.

Default: nothing

type The "type" of the infobox, which is the big centered text beneath the image. For example, on Template:Skakdi, the type is Skakdi.
property1, property2, ..., property10 (optional) The bottom part of the infobox is divided into "properties" and "values." For example, on Raanu, the infobox's first property is "Tribe" and the first value is "Fire." An infobox can have up to 10 property/value pairs. For a property/value pair to appear in the infobox, the value property must be defined. This means that if only value1 through value5 are defined in the infobox, property/value pair 6 through 10 will not appear.

Default: nothing

value1, value2, ..., value10 (optional)
footer (optional) The contents of the infobox's footer. For example, the infobox on BIONICLE Adventures 10: Time Trap has a footer linking to the book's ISBN number.

Default: nothing

Tab parameters

Template:Infobox does not produce tabbed infoboxes! It produces an individual infobox. However, these individual infoboxes can have tab buttons in them. Then a bunch of Template:Infobox instances—each of which represents one infobox—can be strung together to produce a tabbed infobox. Take a look at the code of Template:Toa for an example. (The logic used to connect the tabs can be found at #Extra: tab logic.)

Up to sixteen instances of Template:Infobox can be strung together to produce up to 4 "main tabs" each of which has up to 4 "subtabs."

Parameter Function
maintabcount (optional, but required to have tabs) The amount of main tabs. A number from 1 to 4.

Default: nothing, in which case there are no tabs

currentmaintab (optional, but required to have tabs) The current main tab. In order words, the main tab that this instance of Template:Infobox represents. A number from 1 to 4.

Default: nothing, in which case there are no tabs

subtabcount (optional, but required to have subtabs) The amount of subtabs. A number from 1 to 4.

Default: nothing, in which case there are no subtabs

currentsubtab (optional, but required to have subtabs) The current subtab. In order words, the subtab that this instance of Template:Infobox represents. A number from 1 to 4.

For example, if this instance of Template:Infobox represents the second subtab of the fourth main tab, currentmaintab is 4, and currentsubtab is 2.

Default: nothing, in which case there are no subtabs

active_tab_color (optional) The background color of the tab button that is currently selected.

Default: nothing

  • If infoLight class is applied: rgba(255, 255, 255, 0.2)
  • If infoDark class is applied: rgba(27, 42, 52, 0.1)
tab1_title, tab2_title, tab3_title, tab4_title (each is required if the respective tab exists) The title of the 1st, 2nd, 3rd, and 4th main tabs.

If, for example, there are only 3 main tabs, you only need to provide up to tab3_title.

taba_title, tabb_title, tabc_title, tabd_title (each is required if the respective tab exists) The title of the 1st, 2nd, 3rd, and 4th subtabs beneath the current main tab. For example, if this instance of Template:Infobox represents the fourth main tab, taba_title through tabd_title correspond to the 1st through 4th subtabs of the fourth main tab.

If, for example, there are only 3 subtabs beneath the current main tab, you only need to provide up to tabc_title.

CSS parameters

There are several parameters that can be used to set custom CSS rules for the infobox.

Parameter Function
css (optional) Custom CSS rules for the infobox as a whole.

Default: nothing

headercss (optional) Custom CSS rules for the header (which contains symbolleft, symbolright, and name).

Default: nothing

typecss (optional) Custom CSS rules for the type text.

Default: nothing

footercss (optional) Custom CSS rules for the footer.

Default: nothing

The infoLight and infoDark classes

The infoLight and infoDark classes provide infoboxes with some useful style rules.

infoLight

  • text color is #fff (white)
  • link color is #fff, link weight is bold
  • infobox foreground color is rgba(255, 255, 255, 0.1) (white with 0.1 opacity)
  • infobox active tab color is rgba(255, 255, 255, 0.2) (white with 0.2 opacity)
  • <hr> elements (horizontal lines) are #fff
  • Any background images that are applied to the infobox will have a background-blend-mode of "overlay"

infoDark

  • text color is #1b2a34 (dark bluish gray)
  • link color is #1b2a34, link weight is bold
  • infobox foreground color is rgba(27, 42, 52, 0.1) (dark bluish gray with 0.05 opacity)
  • infobox active tab color is rgba(27, 42, 52, 0.1) (dark bluish gray with 0.1 opacity)
  • Any background images that are applied to the infobox will have a background-blend-mode of "overlay"

Making an infobox

Example infobox

{{Infobox|class=infoLight infoMatoran|bg_color=#32004A
|name=Voriki
|image=[[File:Staff Note.GIF|250px]]
|type=[[Toa]] of [[Energy]]
|property1=Toa Team
|value1=[[Toa Mata]]
|property2=Kanohi
|value2=Great [[Gaaha]]
|property3=Tools
|value3=[[Rod of Lightning]]
|property4=Status
|value4=Alive
|property5=Location
|value5=[[Spherus Magna]]
|property6=Pronunciation
|value6=voh-REE-kee
|property7=Set Number
|value7=8675309
}}

Example infobox template

Making an infobox template is a lot like making an infobox. However, instead of giving the value parameters explicit values, they should be set to parameters themselves so the template's user can configure them later.

Notice the parameters are written like this: {{{blah|}}}. The pipe symbol | basically tells the template that the parameter is optional. If the user leaves it blank, it won't show up on the final infobox.

{{Infobox|class=infoLight infoMatoran|bg_color=#32004A
|name={{{name|}}}
|image={{{image|}}}
|type={{{type}}} <!--required-->
|property1=Toa Team
|value1={{{team|}}}
|property2=Kanohi
|value2={{{mask|}}}
|property3=Tools
|value3={{{tools|}}}
|property4=Status
|value4={{{status|}}}
|property5=Location
|value5={{{location|}}}
|property6=Pronunciation
|value6={{{pron|}}}
|property7=Set Number
|value7={{{setnumber|}}}
}}

Then, to use the template:

{{TemplateName
|name=Voriki
|image=[[File:Staff Note.GIF|250px]]
|type=[[Toa]] of [[Energy]]
|team=[[Toa Mata]]
|mask=Great [[Gaaha]]
|tools=[[Rod of Lightning]]
|status=Alive
|location=[[Spherus Magna]]
|pron=voh-REE-kee
<!--Notice setnumber has been left out. It won't show up on the final infobox.-->
}}

Extra: tab logic

Here's the logic that strings together the tabs of Template:Toa:

  • Main tabs
    • infobox 1 (included even if no tabs)
    • if {{{maintabcount}}} >= 2: infobox 2
    • if {{{maintabcount}}} >= 3: infobox 3
    • if {{{maintabcount}}} >= 4: infobox 4
  • Subtabs for infobox 1
    • if {{{subtab1count}}} exists
      • if {{{subtab1count}}} >= 2: infobox 1b
      • if {{{subtab1count}}} >= 3: infobox 1c
      • if {{{subtab1count}}} >= 4: infobox 1d
  • Subtabs for infobox 2
    • if {{{subtab2count}}} exists
      • if {{{subtab2count}}} >= 2: infobox 2b
      • if {{{subtab2count}}} >= 3: infobox 2c
      • if {{{subtab2count}}} >= 4: infobox 2d
  • Subtabs for infobox 3
    • if {{{subtab3count}}} exists
      • if {{{subtab3count}}} >= 2: infobox 3b
      • if {{{subtab3count}}} >= 3: infobox 3c
      • if {{{subtab3count}}} >= 4: infobox 3d
  • Subtabs for infobox 4
    • if {{{subtab4count}}} exists
      • if {{{subtab4count}}} >= 2: infobox 4b
      • if {{{subtab4count}}} >= 3: infobox 4c
      • if {{{subtab4count}}} >= 4: infobox 4d