Template:Infobox: Difference between revisions
Appearance
imported>Nebulous Maestress I thought I added this param last edit.... |
imported>Nebulous Maestress new infosection params; new autoimage template |
||
| Line 27: | Line 27: | ||
-->{{#arraydefine:$engl_artisangoods | Artisan Goods }}<!-- | -->{{#arraydefine:$engl_artisangoods | Artisan Goods }}<!-- | ||
// END of translations | // END of translations | ||
// Initialize | // Initialize variables | ||
-->{{#arraydefine:$quality|{{ParseInputQuality|quality={{{quality|}}}|iridium={{{iridium|}}}|hide={{{hide|}}}}}}}<!-- | -->{{#arraydefine:$quality|{{ParseInputQuality|quality={{{quality|}}}|iridium={{{iridium|}}}|hide={{{hide|}}}}}}}<!-- | ||
-->{{#switch: {{NAMESPACE}} | -->{{#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"> | ||
| Line 49: | Line 43: | ||
{{!}}- | {{!}}- | ||
{{!}}colspan="2" style="padding-bottom:5px; text-align: center;"{{!}}<!-- | {{!}}colspan="2" style="padding-bottom:5px; text-align: center;"{{!}}<!-- | ||
// Display images, using default name if necessary | |||
// | -->{{Autoimage | ||
-->{{ | |{{{image|}}}, {{{image2|}}}, {{{image3|}}}, {{{image4|}}} | ||
|eng={{{eng|}}}|separator={{#ifeq:{{{image2spacing|}}}|true|   |{{{image2spacing|}}}}}}}<nowiki/> | |||
| {{ | |||
}}}}}}<nowiki/> | |||
{{!}}- | {{!}}- | ||
{{!}}colspan="2" id="infoboxdetail" style="text-align: center; font-style: italic;" {{!}} {{#if:{{{description|}}}|{{{description|}}}|{{Description|{{PAGENAME}}}}}} | {{!}}colspan="2" id="infoboxdetail" style="text-align: center; font-style: italic;" {{!}} {{#if:{{{description|}}}|{{{description|}}}|{{Description|{{PAGENAME}}}}}} | ||
| Line 110: | Line 96: | ||
{{!}} id="infoboxdetail" {{!}} {{Edibility |{{{edibility|}}} |quality={{#arrayprint:$quality}}}} | {{!}} id="infoboxdetail" {{!}} {{Edibility |{{{edibility|}}} |quality={{#arrayprint:$quality}}}} | ||
}}}}<!-- | }}}}<!-- | ||
// custom_price if defined provides entire text of all price-related sections | |||
-->{{#if:{{{custom_price|}}} | |||
|{{{custom_price}}}<!-- | |||
// Display all item prices: Base price plus all professions listed in {{{profession}}} | // Display all item prices: Base price plus all professions listed in {{{profession}}} | ||
// Subtemplate automatically decides how to handle multiple columns, etc. | // Subtemplate automatically decides how to handle multiple columns, etc. | ||
--> | --> |{{Infosection price | ||
| prof = Base {{#if:{{{profession|}}} |, {{{profession|}}}}} | |||
| item = {{{eng|{{{name|{{{PAGENAME}}}}}}}}} | |||
| link = {{{name|{{{PAGENAME}}}}}} | |||
| price = {{{sellprice|}}} | |||
| quality = {{#arrayprint:$quality}} | |||
}}<!-- | |||
}}<!-- | |||
// Add display of products and their prices. | // Add display of products and their prices. | ||
// | // artisan_item is new parameter, that eventually should be able to move alot of the single-item-case data | ||
// onto the individual article pags. | // onto the individual article pags. | ||
// If | // If artisan_item provided, use it to generate the infosection. Otherwise, fallback to old-style manual switch | ||
-->{{#if:{{{ | --> {{#if:{{{artisan_item|}}} | ||
| {{Infosection price | |||
| item = {{{artisan_item}}} | |||
| prof = {{#if:{{{artisan_prof|}}}| {{{artisan_prof}}} | Base,Artisan}} | |||
| artisan = true | |||
| link = {{{artisan_link|}}} | |||
| price = {{{artisan_price|0}}} | |||
| quality = {{{artisan_qual|}}} | |||
| srcprice = {{{sellprice|}}} | |||
| auto = true | |||
}}<!-- | |||
// Manually define various | // Manually define various artisan_item sections | ||
// One key reason to move these details onto the individual infobox pages is for sake of translation -- so that language-specific | // One key reason to move these details onto the individual infobox pages is for sake of translation -- so that language-specific | ||
// translations of | // translations of item can be provided outside of template namespace. | ||
// (Infosection price will recognize some key item names, such as Wine, Juice, Jelly, Pickles, but doing more than that is insane) | // (Infosection price will recognize some key item names, such as Wine, Juice, Jelly, Pickles, but doing more than that is insane) | ||
--> | --> | ||
| {{#switch:{{lc:{{{type|{{{eng|{{{name|{{PAGENAME}}}}}}}}}}}}} | |||
|sunflower = {{Infosection price| | |sunflower = {{Infosection price|prof=base |artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Oil |price=100 |quality=normal}} | ||
|hops = {{Infosection price| | |hops = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Pale Ale,Pickles |price=300}} | ||
|wheat = {{Infosection price| | |wheat = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Beer,Pickles |price=200}} | ||
|honey = {{Infosection price| | |honey = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Mead |price=200 |iridium=true}} | ||
|corn = {{Infosection price| | |corn = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Juice,Pickles,Oil|price=100 |quality=normal}} | ||
|tea leaves={{Infosection price| | |tea leaves= {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Green Tea,Pickles|price=100 |quality=normal}} | ||
|fruit | |fruit | ||
|fruits = {{Infosection price| | |fruits = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Wine,Jelly |price=0 |iridium=true}} | ||
|vegetables | |vegetables | ||
|vegetable = {{Infosection price| | |vegetable = {{Infosection price|prof=base,artisan|artisan=true|auto=true|srcprice={{{sellprice|}}}|item=Juice,Pickles |price=0 |iridium=true}} | ||
|truffle = {{Infosection price| | |truffle = {{Infosection price|prof=base,artisan|artisan=true|item=Truffle Oil |price=1065|quality=normal}} | ||
|milk = {{Infosection price| | |milk = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Cheese |price=230|iridium=true}} | ||
|large milk= {{Infosection price| | |large milk= {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Cheese |price=230|quality=gold,iridium}} | ||
|goat milk = {{Infosection price| | |goat milk = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Goat Cheese |price=400|iridium=true}} | ||
|large goat milk = {{Infosection price| | |large goat milk = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Goat Cheese |price=400|quality=gold,iridium}} | ||
|wool = {{Infosection price| | |wool = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Cloth |price=470|quality=normal}} | ||
|duck egg = {{Infosection price| | |duck egg = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Duck Mayonnaise |price=375|quality=normal}} | ||
|egg = {{Infosection price| | |egg = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Mayonnaise |price=190|quality=normal}} | ||
|dinosaur egg= {{Infosection price| | |dinosaur egg= {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Dinosaur Mayonnaise |price=800|quality=normal}} | ||
|large egg = {{Infosection price| | |large egg = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Mayonnaise |price=190|quality=gold}} | ||
|void | |void egg = {{Infosection price|prof=base,rancher,artisan|artisan=true|item=Void Mayonnaise |price=275|quality=normal}}<!-- | ||
// Add artisan sections to generic item pages. Again, shouldn't be necessary any more once profession is added to original article | // Add artisan sections to generic item pages. Again, shouldn't be necessary any more once profession is added to original article | ||
--> | --> | ||
|wine | |wine | ||
|juice = {{#if:{{{profession|}}}||{{Infosection price| | |juice = {{#if:{{{profession|}}}||{{Infosection price|prof=artisan|item={{{name|{{{{PAGENAME}}}}}}}|price={{{sellprice|}}}|quality=normal}}}} | ||
|aged roe = {{#if:{{{profession|}}}||{{Infosection price| | |aged roe = {{#if:{{{profession|}}}||{{Infosection price|prof=artisan|item={{{name|{{{{PAGENAME}}}}}}}|price={{{sellprice|}}}|quality=normal}}}} | ||
}}}}}}{{#if:{{{ingredients|}}}|<nowiki/> | }}}}}}{{#if:{{{ingredients|}}}|<nowiki/> | ||
{{!}}- | {{!}}- | ||
Revision as of 17:37, 10 September 2020
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" |
| color | Color of artisan goods produced (Jelly, Pickles, Wine, Dehydrator product, etc.) Color name must correspond to an image located in Category:Artisan good images If omitted, color will be the default color for the item (green juice, red jelly, purple wine, etc.) |
| 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) |