Template:Per-game field: Difference between revisions
Jump to navigation
Jump to search
m (Fixed a small coding error that caused there to be an empty space between the "3" and "b" sections when "h" was absent. Boy, that was difficult to find.) |
m (Oops, that was a leftover from me separating the code for easier viewing.) |
||
Line 1: | Line 1: | ||
{{#if:{{{v|}}}{{{v1|}}}{{{v2|}}}{{{v3|}}}{{{vh|}}}{{{vb|}}}{{{dv|}}}|! {{{thparams}}} {{!}} {{{n}}} | {{#if:{{{v|}}}{{{v1|}}}{{{v2|}}}{{{v3|}}}{{{vh|}}}{{{vb|}}}{{{dv|}}}|! {{{thparams}}} {{!}} {{{n}}} | ||
{{!}} {{#if:{{{v|}}} | {{{c|{{{v}}}}}} | {{#if:{{{v1|}}} | | {{!}} {{#if:{{{v|}}} | {{{c|{{{v}}}}}} | {{#if:{{{v1|}}} | {{#if:{{only|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin (game)||x12px}}: }} {{{c1|{{{v1}}}}}} {{#if:{{{v2|}}}{{{v3|}}}{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{v2|}}} | {{#if:{{only|{{{v2|}}}|{{{v1|}}}|{{{v3|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin 2||x12px}}: }} {{{c2|{{{v2}}}}}} {{#if:{{{v3|}}}{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{v3|}}} | {{#if:{{only|{{{v3|}}}|{{{v1|}}}|{{{v2|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin 3||x12px}}: }} {{{c3|{{{v3}}}}}} {{#if:{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{vh|}}} | {{#if:{{only|{{{vh|}}}|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{vb|}}}}}||{{icon|Hey! Pikmin||x12px}}: }} {{{ch|{{{vh}}}}}} {{#if:{{{vb|}}}|<br>}} }} {{#if:{{{vb|}}} | {{#if:{{only|{{{vb|}}}|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{vh|}}}}}||{{icon|Pikmin Bloom||x12px}}: }} {{{cb|{{{vb}}}}}} }} {{#if:{{{v|}}}{{{v1|}}}{{{v2|}}}{{{v3|}}}{{{vh|}}}{{{vb|}}}|| {{{dv}}} }} }} }}<nowiki/><noinclude> | ||
{{#if:{{only|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin (game)||x12px}}: }} {{{c1|{{{v1}}}}}} {{#if:{{{v2|}}}{{{v3|}}}{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{v2|}}} | {{#if:{{only|{{{v2|}}}|{{{v1|}}}|{{{v3|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin 2||x12px}}: }} {{{c2|{{{v2}}}}}} {{#if:{{{v3|}}}{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{v3|}}} | {{#if:{{only|{{{v3|}}}|{{{v1|}}}|{{{v2|}}}|{{{vh|}}}|{{{vb|}}}}}||{{icon|Pikmin 3||x12px}}: }} {{{c3|{{{v3}}}}}} {{#if:{{{vh|}}}{{{vb|}}}|<br>}} }} {{#if:{{{vh|}}} | {{#if:{{only|{{{vh|}}}|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{vb|}}}}}||{{icon|Hey! Pikmin||x12px}}: }} {{{ch|{{{vh}}}}}} {{#if:{{{vb|}}}|<br>}} }} {{#if:{{{vb|}}} | {{#if:{{only|{{{vb|}}}|{{{v1|}}}|{{{v2|}}}|{{{v3|}}}|{{{vh|}}}}}||{{icon|Pikmin Bloom||x12px}}: }} {{{cb|{{{vb}}}}}} }} {{#if:{{{v|}}}{{{v1|}}}{{{v2|}}}{{{v3|}}}{{{vh|}}}{{{vb|}}}|| {{{dv}}} }} }} }}<nowiki/><noinclude> | |||
==Info== | ==Info== |
Revision as of 16:20, December 2, 2021
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
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. | |
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: c = {{{seeds}}} {{tt|seeds|Per item.}}
| |
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. | |
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
{{per-game field | v = | v1 = | v2 = | v3 = | vh = | vb = | dv = | thparams = | n = | c = | c1 = | c2 = | c3 = | ch = | cb = }}