Template:Infobox: Difference between revisions

Want an adless experience? Log in or Create an account.
11,652 bytes removed ,  July 5, 2020
Split documentation to Template:Infobox/Documentation
mNo edit summary
(Split documentation to Template:Infobox/Documentation)
Line 305: Line 305:
</table>
</table>
{{Box/Bottom}}</onlyinclude>
{{Box/Bottom}}</onlyinclude>
 
{{Documentation}}
==Purpose==
This template is used on most pages to display quick high-level information on the subject.
 
==Usage==
Place this template at the top of the article, below any {{Temlink|Hatnote|Hatnotes}} or {{Temlink|Ambox|Amboxes}}. Use whichever parameters are applicable; all are optional.
 
All available parameters:
{{Float|left}}<pre>
{{Infobox|type
| name =
| logo =
| boxart =
| image =
| caption =
| title =
| race =
| gender =
| trial =
| occupation =
| member =
| leader        =
| ship          =
| purpose =
| special =
| number =
| threat =
| attack =
| weapon =
| weaponused =
| element =
| power =
| defense =
| health =
| durability =
| range =
| setbonus =
| ingredients =
| game =
| location =
| dungeon =
| when =
| natseason =
| boss =
| miniboss =
| enemies =
| inhab =
| characters =
| members =
| pointsint =
| item =
| prereq =
| shop =
| owner =
| cost =
| rarity =
| start =
| objective =
| learn =
| tell =
| reward =
| instrument =
| perform =
| use =
| effect =
| dyeable =
| enhanceable =
| related =
| release =
| release <platform1> = <date1>
| release <platform2> = <date2>
| ...
| developer =
| manufacturer =
| publisher =
| producer =
| director =
| author =
| editor =
| artist =
| designer =
| composer =
| arranged =
| album =
| track =
| host =
| type =
| model =
| seasons =
| episodes =
| language =
| length =
| duration =
| size =
| weight =
| color =
| quantity =
| ISBN =
| ASIN =
| catalog =
| wave =
| seriesnumber =
| UPC =
| walkthrough =
| guides =
| gallery =
| videos =
| music =
| date =
| interviewee =
| interviewer =
| description =
| source =
| dept =
| position =
| born =
| died =
| age =
| rank =
| joindate =
| website =
| posts =
| im =
}}
</pre>{{Float|end}}
{{Usage/Param|type|This defines the color of the title. See below for available types.|optional}}
{{Usage/Param|name|This is only necessary when the title of the Infobox should be different from the title of the article. Examples include shortening game titles to their subtitles and removing parenthetical specifications (e.g. [[Hyrule Castle (Twilight Princess)]]).|optional|article title}}
{{Usage/Param|boxart|Used only for games and consoles, this overrides the <code>image</code> parameter.}}
{{Usage/Param|member|Any organization(s) of which the subject is a member.}}
{{Usage/Param|related|Related subjects. For characters, specify the type of relation, e.g. "Talon (Father)" or "Talon (Boss)".}}
{{Usage/Param|threat|A number 1-10.}}
{{Usage/Param|attack|Attacks the enemy or boss may perform, including how much damage they do, using {{Temlink|H}}.}}
{{Usage/Param|weapon|Effective weapons.}}
{{Usage/Param|release|Include as many <code>release</code> arguments as needed, in the form <code>release <platform> {{=}} <date (using {{Temlink|Region}})></code>. <code>release</code> by itself is for console release dates.}}
 
These defined types typically use the same parameters:
 
<div style="display: inline-block;">
===Boss===
{{Float|left}}<pre>
{{Infobox|boss
| image =
| caption =
| title =
| threat =
| attack =
| weapon =
| game =
| dungeon =
| reward =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
 
===Character===
{{Float|left}}<pre>
{{Infobox|character
| image =
| title =
| race =
| gender =
| occupation =
| member =
| game =
| location =
| trial =
| related =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Dungeon===
{{Float|left}}<pre>
{{Infobox|dungeon
| image =
| game =
| location =
| boss =
| miniboss =
| enemies =
| inhab =
| item =
| reward =
| walkthrough =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Enemy===
{{Float|left}}<pre>
{{Infobox|enemy
| image =
| caption =
| threat =
| attack =
| game =
| location =
| weapon =
| reward =
| related =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
 
===Event===
{{Float|left}}<pre>
{{Infobox|event
| image =
| game =
| location =
| characters =
| when =
| related =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Game===
{{Float|left}}<pre>
{{Infobox|game
| name =
| logo =
| boxart =
| caption =
| release <platform1> = <date1>
| release <platform2> = <date2>
| ...
| developer =
| publisher =
| producer =
| director =
| walkthrough =
| guides =
| gallery =
| videos =
| music =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Group===
{{Float|left}}<pre>
{{Infobox|group
| image =
| game =
| location =
| leader        =
| purpose =
| members =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Interview===
{{Float|left}}<pre>
{{Infobox|interview
| date =
| interviewee =
| interviewer =
| description =
| source =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Item===
{{Float|left}}<pre>
{{Infobox|item
| image =
| game =
| location =
| cost =
| ship              =
| use =
| dyeable =
| enhanceable =
| setbonus =
| ingredients =
| related =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Weapon===
{{Float|left}}<pre>
{{Infobox|weapon
| image =
| game =
| element =
| power =
| durability =
| related =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Location===
{{Float|left}}<pre>
{{Infobox|location
| image =
| game =
| inhab =
| pointsint =
| item =
| natseason =
| related =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Member===
{{Float|left}}<pre>
{{Infobox|member
| forumpage =
| image =
| location =
| age =
| rank =
| joindate =
| posts =
| im =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Minigame===
{{Float|left}}<pre>
{{Infobox|minigame
| image =
| game =
| location =
| owner =
| cost =
| objective =
| reward =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Person===
{{Float|left}}<pre>
{{Infobox|person
| image =
| born =
| died =
| game =
| dept =
| position =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
 
===Product===
{{Float|left}}<pre>
{{Infobox|product
| image =
| game =
| cost =
| rarity =
| release =
| developer =
| manufacturer =
| publisher =
| producer =
| director =
| author =
| editor =
| artist =
| designer =
| type =
| model =
| seasons =
| episodes =
| language =
| length =
| size =
| weight =
| quantity =
| color =
| ISBN =
| UPC =
| gallery =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Race===
{{Float|left}}<pre>
{{Infobox|race
| image =
| special =
| game =
| location =
| characters =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Ring===
{{Float|left}}<pre>
{{Infobox|ring
| image =
| number =
| game =
| location =
| prereq =
| effect =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
 
===Secret===
{{Float|left}}<pre>
{{Infobox|secret
| prereq =
| learn =
| learn-img =
| tell =
| tell-img =
| reward =
| rew-img =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Skill===
{{Float|left}}<pre>
{{Infobox|skill
| image =
| game =
| learn =
| perform =
| effect =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Song===
{{Float|left}}<pre>
{{Infobox|song
| image =
| game =
| instrument =
| learn =
| perform =
| effect =
| related =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Quest===
{{Float|left}}<pre>
{{Infobox|quest
| image =
| game =
| prereq =
| start =
| objective =
| reward =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
<div style="display: inline-block;">
===Track===
{{Float|left}}<pre>
{{Infobox|track
| image =
| game =
| album =
| track =
| duration =
| related =
}}
</pre>{{Float|end}}
{{Clear}}</div>
 
{{Clear}}
 
==Adding Rows==
If additional rows are needed, they can be added directly to this template. They generally take the form:
 
{{Float|left|<pre>{{#if: {{{parameter|}}}
| {{Infobox/Row|Label|{{{parameter}}}}}
}}</pre>}}
{{Usage/Param|parameter|The name of the parameter the row deals with. Be sure it hasn't already been used.}}
{{Usage/Param|Label|The label that appears in the left column}}
{{Clear}}
 
Headers can also be added using {{Usage|sub=Header|text}}. They should be surrounded by an 'if' function that checks for any parameters in the section to which the header refers. Check the existing code for examples.
 
Each argument—up to three—passed to Infobox/Row represents one column. To adjust which cells are represented as labels, use the <code>label</code> parameter. <code>label=0</code> makes the whole row data cells; <code>label=1</code> is the default value; <code>label=2</code> makes the first two cells labels; etc.
 
The widths of the columns can be defined using <code><nowiki>{{#vardefine:colNwidth|value}}</nowiki></code>, where <code>value</code> is the width (e.g. "50px") of the Nth column (i.e. define col3width for the third column). This can only be done once per column; once a cell has a defined width, further cells in the same column will share that width, even if the variable is reassigned.
 
===Demo===
The following code demonstrates different behaviors of Infobox/Row. In proper usage, each line should be surrounded by a #if function checking for parameters.
 
{{Usage/Example}}
<pre>
{{Box|width=320px|title=Demonstration|class=infobox}}
<table>
{{Infobox/Header|Header}}
{{Infobox/Row|Colspan'd label}}
{{Infobox/Row|Label|Data}}
{{Infobox/Row|label=0|Colspan'd data}}
{{Infobox/Row|Default|Three column|Behavior}}
{{#vardefine:col3width|100px}}
{{Infobox/Row|label=0|Three|Data|Columns}}
{{Infobox/Row|label=2|Two|Labels|Data}}
{{Infobox/Row|label=3|Three|Label|Columns}}
{{#vardefine:col3width|75px}}
{{Infobox/Row|Different|Col|Width}}
</table>
{{Box/Bottom}}
</pre>
{{Usage/Result|
{{Box|width=320px|title=Demonstration|class=infobox}}
<table>
{{Infobox/Header|Header}}
{{Infobox/Row|Colspan'd label}}
{{Infobox/Row|Label|Data}}
{{Infobox/Row|label=0|Colspan'd data}}
{{Infobox/Row|Default|Three column|Behavior}}
{{#vardefine:col3width|100px}}
{{Infobox/Row|label=0|Three|Data|Columns}}
{{Infobox/Row|label=2|Two|Labels|Data}}
{{Infobox/Row|label=3|Three|Label|Columns}}
{{#vardefine:col3width|15px}}
{{Infobox/Row|Different|Col|Width}}
</table>
{{Box/Bottom}}
}}
 
==Types and Colors==
Common types of Infobox are associated with certain colors, as follows:
{| class="wikitable"
! Types !! Color
|-
| [default] || {{Infobox|name=Default|walkthrough=example}}
|-
| boss<br/>enemy || {{Infobox|boss|name=Hostile|walkthrough=example}}
|-
| dungeon || {{Infobox|dungeon|name=Dungeon|walkthrough=example}}
|-
| location<br/>shop || {{Infobox|location|name=Location|walkthrough=example}}
|-
| character<br/>group<br/>race<br/>shop owner || {{Infobox|character|name=Character|walkthrough=example}}
|-
| item<br/>collectible<br/>ring<br/>weapon<br/>object || {{Infobox|item|name=Item|walkthrough=example}}
|-
| event<br/>minigame<br/>secret<br/>skill<br/>song || {{Infobox|event|name=Knowledge|walkthrough=example}}
|-
| interview<br/>member<br/>person<br/>product<br/>company<br/>publication<br/>game<br/>console<br/>fan game || {{Infobox|interview|name=Nondiegetic|walkthrough=example}}
|}
 
 
{{Cat|Formatting Templates}}
{{Cat|Formatting Templates}}
{{Cat|Infobox Templates}}
{{Cat|Infobox Templates}}