44,445
edits
m (Problem #1.) |
(Added P4.) |
||
(27 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{#if:{{{v|{{{v1|{{{v2|{{{v3|}}} }}} }}} }}} | {{#if:{{{v|}}}{{{v1|}}}{{{v2|}}}{{{v3|}}}{{{v4|}}}{{{vh|}}}{{{vb|}}}{{{dv|}}}|! {{{thparams}}} {{!}} {{{n}}} | ||
! {{{thparams}}} {{!}} {{{n}}} | {{!}} {{#if:{{{v|}}} | {{{c|{{{v}}}}}} | {{#if:{{{v1|}}} | {{#if:{{only|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{v4|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin (game)||x12px}}: }} {{{c1|{{{v1}}}}}} {{#if:{{{v2|}}}{{{v3|}}}{{{v4|}}}{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{v2|}}} | {{#if:{{only|{{{v2|}}}|{{{v1|}}}|{{{v3|}}}|{{{v4|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin 2||x12px}}: }} {{{c2|{{{v2}}}}}} {{#if:{{{v3|}}}{{{v4|}}}{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{v3|}}} | {{#if:{{only|{{{v3|}}}|{{{v1|}}}|{{{v2|}}}|{{{v4|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin 3||x12px}}: }} {{{c3|{{{v3}}}}}} {{#if:{{{v4|}}}{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{v4|}}} | {{#if:{{only|{{{v4|}}}|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin 4||x12px}}: }} {{{c4|{{{v4}}}}}} {{#if:{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{vh|}}} | {{#if:{{only|{{{vh|}}}|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{v4|}}}|{{{vb|}}}}}||{{icon|Hey! Pikmin||x12px}}: }} {{{ch|{{{vh}}}}}} {{#if:{{{vb|}}}|<br>}} }} {{#if:{{{vb|}}} | {{#if:{{only|{{{vb|}}}|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{v4|}}}|{{{vh|}}}}}||{{icon|Pikmin Bloom||x12px}}: }} {{{cb|{{{vb}}}}}} }} {{#if:{{{v|}}}{{{v1|}}}{{{v2|}}}{{{v3|}}}{{{v4|}}}{{{vh|}}}{{{vb|}}}|| {{{dv}}} }} }} }}<nowiki/><noinclude> | ||
{{!}} {{#if:{{{v|}}} | {{{v}}} | {{#if:{{{v1|}}} | {{{v1}}} | |||
==Info== | |||
This template can be used to make the creation of infoboxes with different data between games a lot easier. Suppose there's an attribute of an enemy that, for some enemies, is different between all games. Instead of writing a confusing chain of ifs and parameters left and right inside the infobox, just use this template. It will automatically manage different value cases, equal value cases, and more. | |||
Pass to it the values that would be normally passed into the infobox. If the article that calls the infobox does not provide a value for any of the possible parameters, this template will return nothing. Otherwise, it will return a table row with the information. | |||
==Parameters== | |||
{| class = "wikitable" | |||
! Parameter || Mandatory || Default || Purpose || Detailed description | |||
|- | |||
! v | |||
| No || || Global value || Value passed to the infobox, in the case of it being the same for all games. Omit if this cannot happen (example: enemy health). | |||
|- | |||
! v1 | |||
| No || || ''Pikmin'' value || If the value is different in all games, this is the value passed to the infobox, for ''Pikmin''. | |||
|- | |||
! v2 | |||
| No || || ''Pikmin 2'' value || Same as above, but ''Pikmin 2''. | |||
|- | |||
! v3 | |||
| No || || ''Pikmin 3'' value || Same as above, but ''Pikmin 3''. | |||
|- | |||
! v4 | |||
| No || || ''Pikmin 4'' value || Same as above, but ''Pikmin 4''. | |||
|- | |||
! vh | |||
| No || || ''Hey! Pikmin'' value || Same as above, but ''Hey! Pikmin''. | |||
|- | |||
! vb | |||
| No || || ''Pikmin Bloom'' value || Same as above, but ''Pikmin Bloom''. | |||
|- | |||
! dv | |||
| No || || Default value || If none are provided, use this as the default value. If omitted, the template just returns nothing, instead. | |||
|- | |||
! thparams | |||
| No || || Header parameters || Parameters to pass to the table header element, i.e. the cell that contains the name of the attribute. | |||
|- | |||
! n | |||
| No || || Name of the attribute || Name of the attribute, with links, if needed. | |||
|- | |||
! c | |||
| No || || Custom global display || If you want the global value to be displayed in a special way (e.g. with a tooltip that explains something about the value), write it here. Example: <code><nowiki>c = {{{seeds}}} {{tt|seeds|Per item.}}</nowiki></code> | |||
|- | |||
! c1 | |||
| No || || Custom ''Pikmin'' display || Same as above, but the ''Pikmin'' value. | |||
|- | |||
! c2 | |||
| No || || Custom ''Pikmin 2'' display || Same as above, but the ''Pikmin 2'' value. | |||
|- | |||
! c3 | |||
| No || || Custom ''Pikmin 3'' display || Same as above, but the ''Pikmin 3'' value. | |||
|- | |||
! c4 | |||
| No || || Custom ''Pikmin 4'' display || Same as above, but the ''Pikmin 4'' value. | |||
|- | |||
! ch | |||
| No || || Custom ''Hey! Pikmin'' display || Same as above, but the ''Hey! Pikmin'' value. | |||
|- | |||
! cb | |||
| No || || Custom ''Pikmin Bloom'' display || Same as above, but the ''Pikmin Bloom'' value. | |||
|} | |||
==Skeleton== | |||
<pre> | |||
{{per-game field | v = | v1 = | v2 = | v3 = | v4 = | vh = | vb = | dv = | thparams = | n = | c = | c1 = | c2 = | c3 = | c4 = | ch = | cb = }} | |||
</pre> | |||
[[Category:Utility templates]]</noinclude> |