Difference between revisions of "Template:Infobox"

From Stardew Valley Wiki
Jump to navigation Jump to search
(Template free from "helper" templates and arrays)
Line 1: Line 1:
<includeonly><!--
+
<includeonly>{{#switch:{{NAMESPACE}}
// TRANSLATIONS
 
// Essentially any text that gets displayed on the page should be defined here to make it easier to
 
// port this template to other languages
 
// If the text should be a link, provide entire link as part of the definition
 
 
 
// NOTE: text displayed in infobox that is NOT defined here is generated by subtemplate
 
-->{{#arraydefine:$lang_information  | Information }}<!--
 
-->{{#arraydefine:$lang_source        | Source }}<!--
 
-->{{#arraydefine:$lang_foundin      | Found in }}<!--
 
-->{{#arraydefine:$lang_seed          | Seed }}<!--
 
-->{{#arraydefine:$lang_growthtime    | Growth Time }}<!--
 
-->{{#arraydefine:$lang_buffs        | Buff(s) }}<!--
 
-->{{#arraydefine:$lang_buffduration  | Buff Duration }}<!--
 
-->{{#arraydefine:$lang_xp            | XP }}<!--
 
-->{{#arraydefine:$lang_fishingxp    | Fishing XP }}<!--
 
-->{{#arraydefine:$lang_season        | Season }}<!--
 
-->{{#arraydefine:$lang_healingeffect | Healing Effect }}<!--
 
-->{{#arraydefine:$lang_artisangoods  | Artisan Goods }}<!--
 
-->{{#arraydefine:$lang_crafting      | Crafting }}<!--
 
-->{{#arraydefine:$lang_recipesource  | Recipe Source }}<!--
 
-->{{#arraydefine:$lang_equipment    | Equipment }}<!--
 
-->{{#arraydefine:$lang_processingtime| Processing Time }}<!--
 
-->{{#arraydefine:$lang_timetocraft  | Time to Craft }}<!--
 
-->{{#arraydefine:$lang_ingredients  | Ingredients }}<!--
 
-->{{#arraydefine:$lang_trapper_ingredients  | Trapper Profession Ingredients }}<!--
 
-->{{#arraydefine:$lang_produces      | Produces }}<!--
 
-->{{ParseInputValues|code=itype||
 
,vegetable,vegetable,vegetables,
 
,fruit,fruit,fruits,
 
}}<!--
 
 
 
-->{{#arraydefine:$engl_artisangoods  | Artisan Goods }}<!--
 
 
 
// END of translations
 
// Initialize variables
 
-->{{#arraydefine:$quality|{{ParseInputQuality|quality={{{quality|}}}|iridium={{{iridium|}}}|hide={{{hide|}}}}}}}<!--
 
-->{{#arraydefine:$is_artisan|{{#if:{{{is_artisan|}}}
 
      | {{#ifeq:{{{is_artisan|}}}|0||{{{is_artisan}}}}}
 
      | {{#ifexpr: {{#if:{{#pos:{{lc:{{{source|}}}}}|{{lc:{{#arrayprint:$lang_artisangoods}}}}}}|1|0}}
 
                or {{#if:{{#pos:{{lc:{{{source|}}}}}|{{lc:{{#arrayprint:$engl_artisangoods}}}}}}|1|0}}
 
        |1}}
 
}}}}{{#switch: {{NAMESPACE}}
 
 
|{{ns:User}}|{{ns:User talk}}=
 
|{{ns:User}}|{{ns:User talk}}=
 
|#default=<div id="infoboxborder">
 
|#default=<div id="infoboxborder">
{{{!}} id="infoboxtable"
+
<table id="infoboxtable">
{{!}}colspan="2" id="infoboxheader"{{!}}{{{name|{{PAGENAME}}}}}
+
<tr>
{{!}}-
+
<td colspan="2" id="infoboxheader">{{{name|{{PAGENAME}}}}}</td>
{{!}}colspan="2" style="padding-bottom:5px; text-align: center;"{{!}}<!--
+
</tr>
// Display images, using default name if necessary
+
<tr>
-->{{Autoimage
+
<td colspan="2" style="padding-bottom:5px; text-align: center;">[[File:{{{eng|Blank icon}}}{{#if:{{{ext|}}}|.{{{ext|}}}|.png}}]]{{#if:{{{image2|}}}|{{#ifeq:{{lc:{{{image2spacing|}}}}}|true|&nbsp; &nbsp;|&nbsp;}}[[File:{{{image2|}}}.png]]|}}{{#if:{{{image3|}}}|&nbsp;[[File:{{{image3|}}}.png]]|}}{{#if:{{{image4|}}}|&nbsp;[[File:{{{image4|}}}.png]]|}}{{#if:{{{image5|}}}|&nbsp;[[File:{{{image5|}}}.png]]|}}</td>
      |{{{image|}}}, {{{image2|}}}, {{{image3|}}}, {{{image4|}}}
+
</tr>
      |eng={{{eng|}}}|separator={{#ifeq:{{{image2spacing|}}}|true|&nbsp;&#32;&nbsp;|{{{image2spacing|}}}}}}}<nowiki/>
+
<tr>
{{!}}-
+
<td colspan="2" id="infoboxdetail" style="text-align: center; font-style: italic; padding-right: 3px;">{{#if:{{{description|}}}|{{{description|}}}|{{Description|{{PAGENAME}}}}}}</td>
{{!}}colspan="2" id="infoboxdetail" style="text-align: center; font-style: italic;" {{!}} {{#if:{{{description|}}}|{{{description|}}}|{{Description|{{PAGENAME}}}}}}
+
</tr>
{{!}}-
+
<tr>
{{!}}colspan="2" id="infoboxsection" style="text-align:center;" {{!}} {{#arrayprint:$lang_information}} {{#if:{{{source|}}}|<nowiki/>
+
<td colspan="2" id="infoboxsection" style="text-align:center; padding-left: 0; padding-right: 0;">Information</td>
  {{!}}-
+
</tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_source}}:
+
{{#if:{{{source|}}}|<nowiki/>
  {{!}} id="infoboxdetail" {{!}} {{#ifexist:{{{source|}}}|[[{{{source|}}}]]|{{{source|}}}}}
+
<tr>
 +
<td id="infoboxsection">Source</td>
 +
<td id="infoboxdetail">{{{source|}}}</td>
 +
</tr>
 
}}{{#if:{{{location|}}}|<nowiki/>
 
}}{{#if:{{{location|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_foundin}}:
+
<td id="infoboxsection">Location</td>
  {{!}} id="infoboxdetail" {{!}} {{#ifexist:{{{location|}}}|[[{{{location|}}}]]|{{{location|}}}}}
+
<td id="infoboxdetail">{{{location|}}}</td>
 +
</tr>
 
}}{{#if:{{{seed|}}}|<nowiki/>
 
}}{{#if:{{{seed|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_seed}}:
+
<td id="infoboxsection">Seed</td>
  {{!}} id="infoboxdetail" {{!}} {{#ifexist:{{{seed|}}}|[[{{{seed|}}}]]|{{{seed|}}}}}
+
<td id="infoboxdetail">{{{seed|}}}</td>
 +
</tr>
 
}}{{#if:{{{growth|}}}|<nowiki/>
 
}}{{#if:{{{growth|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_growthtime}}:
+
<td id="infoboxsection">Growth Time</td>
  {{!}} id="infoboxdetail" {{!}} {{{growth|}}}
+
<td id="infoboxdetail">{{{growth|}}}</td>
 +
</tr>
 
}}{{#if:{{{buff|}}}|<nowiki/>
 
}}{{#if:{{{buff|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_buffs}}:
+
<td id="infoboxsection">Buff(s)</td>
  {{!}} id="infoboxdetail" {{!}} {{{buff|}}}
+
<td id="infoboxdetail">{{{buff|}}}</td>
 +
</tr>
 
}}{{#if:{{{buffduration|}}}|<nowiki/>
 
}}{{#if:{{{buffduration|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_buffduration}}:
+
<td id="infoboxsection">Buff Duration</td>
  {{!}} id="infoboxdetail" {{!}} {{duration|{{{buffduration|}}}}}
+
<td id="infoboxdetail">{{duration|{{{buffduration|}}}}}</td>
 +
</tr>
 
}}{{#if:{{{season|}}}|<nowiki/>
 
}}{{#if:{{{season|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_season}}:
+
<td id="infoboxsection">{{#switch:{{lc:{{{eng|}}}}}
  {{!}} id="infoboxdetail" {{!}} {{#iferror: {{Season|{{{season}}}}} | {{{season|}}} | {{Season|{{{season}}}}} }}  
+
|apple|apricot|banana|cherry|mango|orange|peach|pomegranate|tea stage 4=Harvest Season
 +
|#default = Season}}</td>
 +
<td id="infoboxdetail">{{#iferror: {{Season|{{{season}}}}} | {{{season|}}} | {{Season|{{{season}}}}} }}</td>
 +
</tr>
 +
}}{{#if:{{{weather|}}} |<nowiki />
 +
<tr>
 +
<td id="infoboxsection">Weather</td>
 +
<td id="infoboxdetail">{{#iferror: {{Weather inline|{{{weather|}}}}} | {{{weather|}}} | {{Weather inline|{{{weather|}}}}} }}</td>
 +
</tr>
 
}}{{#if:{{{xp|}}}|<nowiki />
 
}}{{#if:{{{xp|}}}|<nowiki />
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_xp}}:
+
<td id="infoboxsection" title="Experience Points">XP</td>
  {{!}} id="infoboxdetail"  {{!}} {{{xp|}}}
+
<td id="infoboxdetail">{{{xp|}}}</td>
}}{{#if:{{{fishingxp|}}}|<nowiki />
+
</tr>
  {{!}}-
+
}}{{#if:{{{edibility|}}}|<nowiki />
 
+
<tr>
 +
{{#switch:{{lc:{{{edibility|}}}}}
 +
| -300|inedible|ungenießbar|incomible|non comestible|immangiabile|食べられません|먹을 수 없음|ehetetlen|não comestível|несъедобный|yenmez|不可食用=
 +
<td id="infoboxsection">Energy</td>
 +
<td id="infoboxdetail">''Inedible''</td>
 +
|#default = {{#ifexpr:{{#expr:{{{edibility|}}}>-300 and {{{edibility|}}}<0}} |<nowiki />
 +
<td id="infoboxsection">Energy</td>
 +
<td id="infoboxdetail">
 +
<table style="margin: 0; padding: 0; border-spacing: 0;">
 +
<tr>
 +
<td> [[File:Poison.png|24px|link=]]</td>
 +
<td> {{#replace:{{#expr:ceil({{{edibility|}}}*2.5)}}|-|&minus;}} [[Energy]]</td>
 +
</tr>
 +
{{#switch:{{lc:{{{quality|}}}}}
 +
|false|normal=
 +
|#default=
 +
<tr>
 +
<td style="vertical-align: top;"><div id="qualitycontainersm"><div id="qualityimage">[[File:Poison.png|24px|link=]]<div class="qualityindicator">[[File:Silver Quality Icon.png|24px|link=]]</div></div></div></td>
 +
<td>{{#replace:{{#expr:trunc(ceil({{{edibility|}}}*2.5)+{{{edibility|}}})}}|-|&minus;}} [[Energy]]</td>
 +
</tr>
 +
<tr>
 +
<td><div id="qualitycontainersm"><div id="qualityimage">[[File:Poison.png|24px|link=]]<div class="qualityindicator">[[File:Gold Quality Icon.png|24px|link=]]</div></div></div></td>
 +
<td> {{#replace:{{#expr:trunc(ceil({{{edibility|}}}*2.5)+{{{edibility|}}}*2)}}|-|&minus;}} [[Energy]]</td>
 +
</tr>
 +
<tr>
 +
<td><div id="qualitycontainersm"><div id="qualityimage">[[File:Poison.png|24px|link=]]<div class="qualityindicator">[[File:Iridium Quality Icon.png|24px|link=]]</div></div></div></td>
 +
<td> {{#replace:{{#expr:trunc(ceil({{{edibility|}}}*2.5)+{{{edibility|}}}*4)}}|-|&minus;}} [[Energy]]</td>
 +
</tr> }}
 +
</table>
 +
</td>
 +
}}{{#ifexpr:{{#expr:{{{edibility|}}} = 0}}|<nowiki />
 +
<td id="infoboxsection">[[Energy|<span style="color: white;">Energy</span>]] / [[Health|<span style="color: white;">Health</span>]]</td>
 +
<td id="infoboxdetail" class="no-wrap">[[File:Energy.png|24px|link=]] 0 [[File:Health.png|24px|link=]] 0</td>
 +
    }}{{#ifexpr:{{#expr:{{{edibility|}}}>0}} |<nowiki />
 +
<td id="infoboxsection">[[Energy|<span style="color: white;">Energy</span>]] / [[Health|<span style="color: white;">Health</span>]]</td>
 +
<td id="infoboxdetail">
 +
<table style="padding: 0; margin: 0 0 2px 0; border-spacing: 0;">
 +
<tr>
 +
<td style="padding: 0;">[[File:Energy.png|24px|link=]]</td>
 +
<td class="no-wrap" style="text-align: right;">{{#expr:ceil({{{edibility|}}}*2.5)}}</td>
 +
<td style="width: 12px;"></td>
 +
<td style="padding: 0;">[[File:Health.png|24px|link=]]</td>
 +
<td class="no-wrap" style="text-align: right;">{{#expr:trunc(ceil({{{edibility|}}}*2.5)*0.45)}}</td>
 +
</tr>
 +
{{#switch:{{lc:{{{quality|}}}}}
 +
|false|normal=
 +
|#default=
 +
<tr>
 +
<td style="padding: 0;"><div id="qualitycontainersm"><div id="qualityimage">[[File:Energy.png|24px|link=]]<div class="qualityindicator">[[File:Silver Quality Icon.png|24px|link=]]</div></div></div></td>
 +
<td class="no-wrap" style="padding: 0; text-align: right;">{{#expr:trunc(ceil({{{edibility|}}}*2.5)+{{{edibility|}}})}}</td>
 +
<td style="width: 4px; padding: 0;">
 +
<td style="padding: 0;"><div id="qualitycontainersm"><div id="qualityimage">[[File:Health.png|24px|link=]]<div class="qualityindicator">[[File:Silver Quality Icon.png|24px|link=]]</div></div></div></td>
 +
<td class="no-wrap" style="padding: 0; text-align: right;">{{#expr:trunc(trunc(ceil({{{edibility|}}}*2.5)+{{{edibility|}}})*0.45)}}</td>
 +
</tr>
 +
<tr>
 +
<td style="padding: 0;"><div id="qualitycontainersm"><div id="qualityimage">[[File:Energy.png|24px|link=]]<div class="qualityindicator">[[File:Gold Quality Icon.png|24px|link=]]</div></div></div></td>
 +
<td class="no-wrap" style="padding: 0; text-align: right;">{{#expr:trunc(ceil({{{edibility|}}}*2.5)+{{{edibility|}}}*2)}}</td>
 +
<td></td>
 +
<td style="padding: 0;"><div id="qualitycontainersm"><div id="qualityimage">[[File:Health.png|24px|link=]]<div class="qualityindicator">[[File:Gold Quality Icon.png|24px|link=]]</div></div></div></td>
 +
<td class="no-wrap" style="padding: 0; text-align: right;">{{#expr:trunc(trunc(ceil({{{edibility|}}}*2.5)+{{{edibility|}}}*2)*0.45)}}</td>
 +
</tr>
 +
<tr>
 +
<td style="padding: 0;"><div id="qualitycontainersm"><div id="qualityimage">[[File:Energy.png|24px|link=]]<div class="qualityindicator">[[File:Iridium Quality Icon.png|24px|link=]]</div></div></div></td>
 +
<td class="no-wrap" style="padding: 0; text-align: right;">{{#expr:trunc(ceil({{{edibility|}}}*2.5)+{{{edibility|}}}*4)}}</td>
 +
<td></td>
 +
<td style="padding: 0;"><div id="qualitycontainersm"><div id="qualityimage">[[File:Health.png|24px|link=]]<div class="qualityindicator">[[File:Iridium Quality Icon.png|24px|link=]]</div></div></div></td>
 +
<td class="no-wrap" style="padding: 0; text-align: right;">{{#expr:trunc(trunc(ceil({{{edibility|}}}*2.5)+{{{edibility|}}}*4)*0.45)}}</td>
 +
</tr>
 +
}}
 +
</table>
 +
</tr>
 +
}} }} }}{{#if:{{{sellprice|}}} |<nowiki />
 +
<tr>
 +
{{#switch:{{lc:{{{eng|}}}}}
 +
|copper bar|iron bar|gold bar|iridium bar|radioactive bar =
 +
<td colspan="2" style="padding: 0; border: 0;">
 +
<table style="width: 101%; margin-top: -2px; margin-left: -2px;">
 +
<tr>
 +
<td id="infoboxsection" colspan="2" style="text-align: center; padding-left: 0; padding-right: 0;">Sell Prices</td>
 +
</tr>
 +
<tr>
 +
<td id="infoboxsection">Base</td>
 +
<td id="infoboxsection" class="no-wrap">[[File:Blacksmith Icon.png|24px|link=]] [[Skills#Mining|<span style="color: white;">Blacksmith</span>]] ''(+50%)''</td>
 +
</tr>
 +
<tr>
 +
<td>[[File:{{{eng|Blank icon}}}.png|24px|link=]]{{formatnum:{{{sellprice|}}}}}g</td>
 +
<td>[[File:{{{eng|Blank icon}}}.png|24px|link=]]{{formatnum:{{#expr: trunc(trunc(15 * {{{sellprice
 
}}{{#if:{{{recipe|}}}|<nowiki/>
 
}}{{#if:{{{recipe|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_recipesource}}:
+
<td id="infoboxsection">Recipe Source</td>
  {{!}} id="infoboxdetail" {{!}} {{{recipe|}}}
+
<td id="infoboxdetail">{{{recipe|}}}</td>
 +
</tr>
 
}}{{#if:{{{craftingstation|}}}|<nowiki/>
 
}}{{#if:{{{craftingstation|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_equipment}}:
+
<td id="infoboxsection">Equipment</td>
  {{!}} id="infoboxdetail" {{!}} {{{craftingstation|}}}
+
<td id="infoboxdetail">{{{craftingstation|}}}</td>
 +
</tr>
 
}}{{#if:{{{crafttime|}}}|<nowiki/>
 
}}{{#if:{{{crafttime|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" class="no-wrap" {{!}} {{#if:{{#arrayprint:$is_artisan}} | {{#arrayprint:$lang_processingtime}} | {{#arrayprint:$lang_timetocraft}} }}:
+
<td id="infoboxsection">Processing Time</td>
  {{!}} id="infoboxdetail" {{!}} {{duration|{{{crafttime|}}}}}
+
<td id="infoboxdetail">{{duration|{{{crafttime|}}}}}</td>
 +
</tr>
 
}}{{#if:{{{ingredients|}}}|<nowiki/>
 
}}{{#if:{{{ingredients|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_ingredients}}:
+
<td id="infoboxsection">Ingredients</td>
  {{!}} id="infoboxdetail" {{!}} {{{ingredients|}}}
+
<td id="infoboxdetail">{{{ingredients|}}}</td>
}}{{#if:{{{tingredients|}}}|<!--
+
</tr>
 
+
}}{{#if:{{{tingredients|}}}|<nowiki/>
//Trapper Profession ingredients for Crab Pot
+
<tr>
--><nowiki/>
+
<td id="infoboxsection">[[File:Trapper.png|24px|link=]] [[Skills#Fishing|<span style="color: white;">Trapper</span>]] Ingredients</td>
  {{!}}-
+
<td id="infoboxdetail">{{{tingredients|}}}</td>
  {{!}} id="infoboxsection" {{!}} [[File:Trapper.png|24px|link=]] {{#arrayprint:$lang_trapper_ingredients}}:
+
</tr>
  {{!}} id="infoboxdetail" {{!}} {{{tingredients|}}}
 
 
}}{{#if:{{{produces|}}}|<nowiki/>
 
}}{{#if:{{{produces|}}}|<nowiki/>
  {{!}}-
+
<tr>
  {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_produces}}:
+
<td id="infoboxsection">Produces</td>
  {{!}} id="infoboxdetail" {{!}} {{{produces|}}}
+
<td id="infoboxdetail">{{{produces|}}}</td>
}}<nowiki/>
+
</tr>
{{!}}}
+
}}
</div>
+
</table>
{{InfoboxSEO}}}}</includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>
+
</div>{{InfoboxSEO}}}}</includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>

Revision as of 18:15, 16 December 2022

Description

This template displays a generic infobox for a wide variety of items. Do not use this on your user page. It is reserved for content pages.

Parameters

All parameters are optional. If omitted, nothing will display.

Parameter Notes
eng Name of the image to display, in English, without the ".png" extension.
If the image has an extension other than ".png", then the "ext" parameter must be used.
ext Extension of image specified in "eng" parameter, without the period (e.g., "gif", "jpg", etc.)
name Name of item (Page name if omitted)
For use on pages like Trash (item) where the name of the item is different from the page name.
image2
image3
image4
image5
Name of additional images to display
Must be of type ".png"
Omit the extension (e.g., Tiger Slime Egg)
image2spacing Set to "true" to add extra space between the images specified in "eng" and "image2"
description In-game item description
(Populated by Template:Description if omitted). It is preferable to omit this parameter and update Template:Description instead.
source How to obtain the item (e.g., [[Crafting]], [[Artisan Goods]], [[Slime Egg-Press]])
location Location(s) of item (e.g., [[Cindersap Forest]], [[The Beach]], Bushes throughout the valley, etc.)
seed Name of seed (e.g., {{Name|Corn Seeds}})
growth Number of days the crop takes to grow to maturity (e.g., 4 days)
buff Name of buff(s) given by the item (e.g., {{Name|Farming|+4}})
buffduration Length of time buff(s) are active
season Name of season when the item can be obtained or grown
Can be plain text (e.g., Spring, Summer, All, etc.) or can use Template:Season (e.g., {{Season|Summer}} • {{Season|Winter}})
weather Weather required to obtain the item
Can use plain text (e.g., Rain) and this template will automatically apply Template:Weather inline formatting
xp Experience points gained for harvesting or otherwise obtaining the item
edibility Found in Data\ObjectInformation.xnb
Note that inedible items have an edibility of -300, and poisonous items have a negative edibility greater than -300
sellprice Found in Data\ObjectInformation.xnb
If the item cannot be sold, then "N/A" and "Cannot be sold" are valid values
quality Set to "false" to suppress silver, gold, and iridium qualities
recipe How to obtain the recipe to craft the item (e.g., [[Farming]] Level 7)
craftingstation Equipment used to craft the item (e.g., {{Name|Preserves Jar}})
crafttime How long does the item process in its equipment (e.g., 4 hours)
ingredients Ingredients needed to craft the item (e.g., {{Name|Copper Bar|2}}{{Name|Sap|10}})
tingredients Ingredients with the Trapper profession
Used on the Crab Pot page
produces Item produced via crafting, artisan goods, or harvesting (e.g., 5 Deluxe Fertilizer per craft)