Difference between revisions of "Template:Infobox/doc"

From Stardew Valley Wiki
Jump to navigation Jump to search
(add new artisan params to list)
(Updated parameters)
Line 8: Line 8:
 
}}
 
}}
  
This template displays a generic infobox for a wide variety of items.  Note that several categories of item have customized variants of the generic infobox; see [[:Category:Infobox templates]] for a complete listing.
+
The [[Template:Infobox|Infobox]] template displays a generic infobox for a wide variety of items.  Note that several categories of item have customized variants of the generic infobox; see [[:Category:Infobox templates]] for a complete listing.
  
 
==Notes==
 
==Notes==
Line 16: Line 16:
  
 
==Usage==
 
==Usage==
 
The ''image2 - image4'' parameters can be used to display more than one image file. For example,[[File:Egg.png|32px]][[File:Brown_Egg.png|32px]] ([[Egg]] and [[Egg|Brown Egg]]).
 
 
This template will automatically populate some links from plain text. Source and season will automatically scan for associate articles and make links if they exist.
 
 
 
===Syntax===
 
===Syntax===
 
   <nowiki>{{</nowiki>[[Template:Infobox|Infobox]]
 
   <nowiki>{{</nowiki>[[Template:Infobox|Infobox]]
Line 51: Line 46:
 
     |fishingxp      = Details of XP
 
     |fishingxp      = Details of XP
 
     |tingredients    = ingredients with the Trapper profession
 
     |tingredients    = ingredients with the Trapper profession
     |artisanitem     = Name(s) of item(s) derived from primary item by processing
+
     |price_ncols     = to change whether non-artisan prices are displayed horizontally or vertically
     |artisanprofession = Professions that affect prices of artisanitems
+
    |artisan_item    = Name(s) of item(s) derived from primary item by processing
     |alt_artisanitem = Language-specific eqivalents for artisanitems
+
     |artisan_prof    = Professions that affect prices of artisan_item
     |artisanprice    = Base price of artisanitems
+
     |artisan_link    = Language-specific eqivalents for artisan_item
     |artisanquality  = Qualities of artisanitems
+
     |artisan_price  = Base price of artisan_item
 +
     |artisan_qual    = Qualities of artisan_item
 +
    |artisan_ncols  = to change whether non-artisan prices are displayed horizontally or vertically
 +
    |custom_price    = to override entire price section with customized output from [[Template:Infosection price|Infosection price]]
 
   <nowiki>}}</nowiki>
 
   <nowiki>}}</nowiki>
  
Line 67: Line 65:
 
** Name of image(s) to display in infobox. Default is <tt>page_name</tt>.png
 
** Name of image(s) to display in infobox. Default is <tt>page_name</tt>.png
 
*** On non-English wikis, default value is <tt>eng</tt>.png
 
*** On non-English wikis, default value is <tt>eng</tt>.png
** If more than one image should be displayed, multiple image names can be provided, separated by commas
+
** If more than one image should be displayed, multiple image names can be provided, separated by commas. For example, use <tt>image=Egg, Brown Egg</tt> to display [[File:Egg.png|32px]][[File:Brown_Egg.png|32px]].
 
** The image names should include the extension (.jpg, .gif, etc) if the images are not in .png format; otherwise the extension is optional and .png will automatically be appended
 
** The image names should include the extension (.jpg, .gif, etc) if the images are not in .png format; otherwise the extension is optional and .png will automatically be appended
  
Line 159: Line 157:
  
 
* '''fishingxp = ''values'''''
 
* '''fishingxp = ''values'''''
* See [[Green Algae]] for example of usage
+
** See [[Green Algae]] for example of usage
 +
 
 +
* '''price_ncols = ''ncols'''''
 +
** Set to 1 to force standard (non-artisan) prices to be displayed vertically, in all right-hand column; set to 2 or 3 to force prices to be displayed horizontally.
  
* '''artisanitem = ''values''''' and all other '''artisan*****''' parameters
+
* '''artisan_item = ''values''''' and all other '''artisan_*****''' parameters
** If artisanitem is set, a second grid of prices will be displayed showing prices for items derived/created from the primary item.
+
** If artisan_item is set, a second grid of prices will be displayed showing prices for items derived/created from the primary item.
** <tt>artisanitem</tt> should be a comma separated list of the names of derived/crafted/artisan items to be included in the price grid
+
** <tt>artisan_item</tt> should be a comma separated list of the names of derived/crafted/artisan items to be included in the price grid
 
** The variables are all passed to [[Template:Infosection price]], which generates the actual price grid, using <tt>artisan=true</tt>.  For complete documentaton of the parameter meanings see Infosection price. The parameters recognized by Infobox, and the equivalent parameters in Infosection price, are:
 
** The variables are all passed to [[Template:Infosection price]], which generates the actual price grid, using <tt>artisan=true</tt>.  For complete documentaton of the parameter meanings see Infosection price. The parameters recognized by Infobox, and the equivalent parameters in Infosection price, are:
*** artisanitem -> sellitem
+
*** artisan_item -> item
*** alt_artisanitem -> alt_sellitem
+
*** artisan_link -> link
*** artisanprice -> sellprice
+
*** artisan_price -> price
*** artisanprofession -> profession
+
*** artisan_prof -> prof
*** artisanimage -> sellimage
+
*** artisan_qual -> quality
*** artisanquality -> quality
+
*** artisan_ncols -> ncolumns
*** artisanoneitempercol -> oneitempercol
+
 
*** artisancolumns -> ncolumns
+
* '''custom_price = ''template'''''
*** sellprice -> sourceprice
+
** If custom_price is set, it provides the entire content of the price section of the infobox (both standard prices and artisan prices).
 +
** Typically custom_price is assigned one or more template calls to [[Template:Infosection price]], which handles the word of generating the content.
 +
** For an example, see [[Salmonberry]].
 +
** This allows all the parameters/functionality of Infosection price to be used to create fully customized price sections, for items that have non-standard needs.
  
 
===Examples===
 
===Examples===

Revision as of 19:11, 24 September 2020

Example
Blank icon.png
Example description text
Information
Season Spring, summer
Energy / Health
Energy.png
25
Health.png
11

The Infobox template displays a generic infobox for a wide variety of items. Note that several categories of item have customized variants of the generic infobox; see Category:Infobox templates for a complete listing.

Notes

  • Many of the input values expect to be plain text values, which are then automatically formatted, converted into links, etc.
  • Currently the template includes hard-coded support for several specialized features, in particular, derived artisan products for many items. Most of these are no longer necessary, and would be better handled by modifying the individual item pages to provide the relevant information. Once all item pages in all languages have been updated, this information should be removed from the template.

Usage

Syntax

 {{Infobox
   |name            = Name of Item (Page name if omitted)
   |image           = file_name.png (Page name.png if omitted)
   |description     = In-game description of the item (optional -- populated by Template:Description if omitted) 
   |location        = Location(s) where item is found
   |source          = Farming / Quest / Shop
   |edibility       = 20
   |sellprice       = 14
   |type            = fruit, vegetable
   |quality         = true / false / list of qualities to show
   |iridium         = true <- add iridium quality stars rating
   |profession      = Rancher / Tiller / Artisan / Blacksmith / Forester / Tapper
   |seed            = seed name
   |season          = Spring, Summer, Fall, Winter, All
   |growth          = 4 days
   |buff            = buff effects
   |buffduration    = buff duration
   |craftingstation = {{name|Preserves Jar}} <- use the name template, then list the station name
   |ingredients     = {{name|Fish|13}} {{name|item|#}} <- use the name template, then list the item and # of ingredient needed
   |recipe          = Source of recipe
   |crafttime       = Crafting time
   |image2          = Second image (deprecated - use multiple values in image instead)
   |image3          = Third image (deprecated)
   |image4          = Fourth image (deprecated)
   |image2spacing   = true to add space between multiple images
   |is_artisan      = true only if necessary for artisan goods section of infobox
   |eng             = English version name of item (only relevant on non-English wikis)
   |fishingxp       = Details of XP
   |tingredients    = ingredients with the Trapper profession
   |price_ncols     = to change whether non-artisan prices are displayed horizontally or vertically
   |artisan_item    = Name(s) of item(s) derived from primary item by processing
   |artisan_prof    = Professions that affect prices of artisan_item
   |artisan_link    = Language-specific eqivalents for artisan_item
   |artisan_price   = Base price of artisan_item
   |artisan_qual    = Qualities of artisan_item
   |artisan_ncols   = to change whether non-artisan prices are displayed horizontally or vertically
   |custom_price    = to override entire price section with customized output from Infosection price
 }}

Parameters

All parameters are named and optional. Only parameters relevant to the current item should be provided (completely delete irrelevant ones to fully omit from the infobox). Default value for all arguments is empty, unless specified otherwise.

  • name = item_name
    • Name of item. Default is page name
  • image = image_name
    • Name of image(s) to display in infobox. Default is page_name.png
      • On non-English wikis, default value is eng.png
    • If more than one image should be displayed, multiple image names can be provided, separated by commas. For example, use image=Egg, Brown Egg to display Egg.pngBrown Egg.png.
    • The image names should include the extension (.jpg, .gif, etc) if the images are not in .png format; otherwise the extension is optional and .png will automatically be appended
  • description = description
    • In-game description of the item. Populated by Template:Description if omitted.
    • Note that the description is expected to exactly match the in-game description -- if there are typos, errors, etc., they should be reproduced exactly.
  • location = values
    • Locations where the item can be found, in particular via foraging
    • If only a single location is provided, the value can be plain text and will be auto-converted into a link.
    • If multiple locations are provided, each should be formatted as a link, and the values separated by a bullet (&bullet;)
  • source = values
    • How to obtain the item (other than foraging)
    • If only a single location is provided, the value can be plain text and will be auto-converted into a link.
    • If multiple locations are provided, each should be formatted as a link, and the values separated by a bullet (&bullet;)
  • edibility = base_edibility
    • Base edibility of the item, as extracted from ObjectInformation.xnb
    • See Template:Edibility for details
    • For inedible items, specify edibility=-300 or edibility=inedible. Or if it is an item that nobody would ever expect to be able to eat, omit the line entirely (to remove the section from the infobox)
  • sellprice = sellprice
    • Base price of the item, as extracted from ObjectInformation.xnb
    • Use profession to list all relevant price bonuses
  • type = fruit, vegetable
    • Only recognized values are fruit and vegetable
    • Causes information on derived Wine, Jelly, Juice, and Pickles to be automatically added to the infobox
  • quality = values
    • A list of quality values (Normal, Silver, Gold, Iridium) that are valid for this item. Default value is Normal, Silver, Gold
  • iridium = true
    • Set iridium to true to add Iridium to the list of qualities.
    • Easier to do by including Iridium as a value for quality; iridium parameter only provided for consistency with other templates.
  • profession = values
    • A comma-separated list of all professions that adjust the price of this item. See Template:Infosection price for a list of valid entries.
  • seed = item_name
    • The name of the seed from which a crop item grows; only relevant for crops
    • Should be a plain text name; will be automatically converted into a link
  • season = season
    • The name of the season(s) when this item is available; if multiple seasons are possible, they should be comma-separated
    • Possible values are: Spring, Summer, Fall, Winter, All Seasons
    • Values should be plain text (no links, no icons); template will automatically apply formatting
    • See Template:Season for details.
    • For items which are obviously not dependent upon the season (furniture, minerals, etc.), this line should be omitted entirely (to remove the section from the infobox).
  • growth = days
    • Only relevant for crops; number of days to grow (without any fertilizers, etc.)
    • The text should not just be a number, but should also include "days", e.g., growth=4 days
  • buff = buff
    • A list of all buffs that are obtained when eating this item, including magnitude of bonus
    • Entries should be fully formatted (with links)
  • buffduration = duration
    • The duration of any buffs obtained when eating this item. Template:Duration will automatically be called to add a duration icon; no other formatting is applied to the input value.
  • craftingstation = name
    • The name of the equipment necessary to produce this item.
    • Use the name template, e.g., craftingstation={{name|Preserves Jar}}
  • ingredients = values
    • List of all ingredients / source items necessary to produce this item
    • The Name template should be used to format each item name and specify the quantity necessary
  • recipe = value
    • Where the player obtains/learns the recipe necessary to produce this item
  • crafttime = value
    • Time necessary to produce this time
  • image2 = value, image3=value, image4=value
    • Only provided for backwards compatibility; better to provide multiple image names to image
  • image2spacing = true
    • Set to true to add horizontal space between multiple images
  • is_artisan=true
    • Set to true if this item is an artisan good; set to 0 if item is not.
    • Default value is automatically set to true if 'artisan goods' is listed in source
    • Only relevance is wording used in a couple places on template
    • Title of final section of infobox is "Artisan Goods" if true; "Crafting" if not
    • Label used for crafttime parameter is "Processing Time" if true; "Time to Craft" if not
  • eng = item_name
    • English equivalent of name. Only relevant on non-English wikis
  • fishingxp = values
  • price_ncols = ncols
    • Set to 1 to force standard (non-artisan) prices to be displayed vertically, in all right-hand column; set to 2 or 3 to force prices to be displayed horizontally.
  • artisan_item = values and all other artisan_***** parameters
    • If artisan_item is set, a second grid of prices will be displayed showing prices for items derived/created from the primary item.
    • artisan_item should be a comma separated list of the names of derived/crafted/artisan items to be included in the price grid
    • The variables are all passed to Template:Infosection price, which generates the actual price grid, using artisan=true. For complete documentaton of the parameter meanings see Infosection price. The parameters recognized by Infobox, and the equivalent parameters in Infosection price, are:
      • artisan_item -> item
      • artisan_link -> link
      • artisan_price -> price
      • artisan_prof -> prof
      • artisan_qual -> quality
      • artisan_ncols -> ncolumns
  • custom_price = template
    • If custom_price is set, it provides the entire content of the price section of the infobox (both standard prices and artisan prices).
    • Typically custom_price is assigned one or more template calls to Template:Infosection price, which handles the word of generating the content.
    • For an example, see Salmonberry.
    • This allows all the parameters/functionality of Infosection price to be used to create fully customized price sections, for items that have non-standard needs.

Examples

Corn
Blank icon.png
One of the most popular grains. The sweet, fresh cobs are a summer favorite.
Information
Source Farming
Season Spring.png Spring
Energy / Health
Energy.png
25
Health.png
11
Energy.png
Silver Quality Icon.png
35
Health.png
Silver Quality Icon.png
15
Energy.png
Gold Quality Icon.png
45
Health.png
Gold Quality Icon.png
20
Energy.png
Iridium Quality Icon.png
65
Health.png
Iridium Quality Icon.png
29
Sell Price
Blank icon.png
14g
Blank icon.png
Silver Quality Icon.png
17g
Blank icon.png
Gold Quality Icon.png
21g
Blank icon.png
Iridium Quality Icon.png
28g
Crafting
Equipment Preserves Jar.png Preserves Jar
Ingredients Fish.png Fish (13) Tomato Seeds.png Tomato Seeds (13)

The code below generates the infobox shown to the right.

{{Infobox
|name            = Corn
|image           = Corn.png
|description     = {{Description|Corn}}
|source          = Farming
|season          = [[Spring]]
|craftingstation = {{name|Preserves Jar}}
|ingredients     = {{name|Fish|13}} {{name|Tomato Seeds|13}}
|edibility       = 10
|type            = vegetable
|sellprice       = 14
|iridium         = true
|profession      = Rancher,Blacksmith
}}
Corn
Blank icon.png
A juicy little bean with a cool, crisp snap.
Information
Location Pelican Town
Seed Radish Seeds
Growth Time 6 days
Buff(s) Foraging.png Foraging (+2)Defense.png Defense (+2)
Buff Duration Time Icon.png 7m 41s
Season Spring.png Spring
Energy / Health
Energy.png
25
Health.png
11
Sell Price data-sort-value="14">Gold.png14g
Crafting
Equipment Preserves Jar.png Preserves Jar
Ingredients Fish.png Fish (13) Tomato Seeds.png Tomato Seeds (13)

The code below generates the infobox shown to the right.

{{Infobox
|name            = Corn
|location        = [[Pelican Town]]
|image           = 
|description     = {{Description|Green Bean}}
|seed            = [[Radish Seeds]]
|season          = Spring
|growth          = 6 days
|buff            = {{name|Foraging|+2}}{{name|Defense|+2}}
|buffduration    = 7m 41s
|craftingstation = {{name|Preserves Jar}}
|ingredients     = {{name|Fish|13}} {{name|Tomato Seeds|13}}
|edibility       = 10
|sellprice       = 14
|iridium         = true
|profession      = Tapper
|quality         = false
}}