Changes

8,071 bytes added ,  06:09, 6 September 2020
somewhat more complete documentation
Line 1: Line 1:  
{{Infobox
 
{{Infobox
|name            =
+
|name            = Example
|image          =  
+
|image          = Blank_icon
|description    =  
+
|description    = ''Example description text''
|source          =
+
|season          = spring, summer
|season          =  
+
|edibility      = 10
|craftingstation =  
+
|quality        = Normal
|ingredients    =
  −
|sellprice      =  
   
}}
 
}}
   −
==Description==
+
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.
This template displays a general infobox for a wide variety of items.
      
==Notes==
 
==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==
 +
 
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]]).
 
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]]).
 
   
 
   
Line 19: Line 22:     
===Syntax===
 
===Syntax===
<pre>
+
  <nowiki>{{</nowiki>[[Template:Infobox|Infobox]]
{{Infobox
+
    |name            = Name of Item (Page name if omitted)
|name            = Name of Item (Page name if omitted)
+
    |image          = file_name.png (Page name.png 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)  
|description    = In-game description of the item (optional -- populated by Template:Description if omitted)
+
    |location        = Location(s) where item is found
|location        = [[foraging location]]
+
    |source          = Farming / Quest / Shop
|source          = Farming / Quest / Shop
+
    |edibility      = 20
|seed            = [[seed name]]
+
    |sellprice      = 14
|season          = Spring / Winter / Fall / Summer
+
    |type            = fruit, vegetable
|growth          = 4 days
+
    |quality        = true / false / list of qualities to show
|buff            = buff effects
+
    |iridium        = true <- add iridium quality stars rating
|buffduration    = buff duration
+
    |profession      = Rancher / Tiller / Artisan / Blacksmith / Forester / Tapper
|craftingstation = {{name|Preserves Jar}} <- use the name template, then list the station name
+
    |seed            = seed name
|ingredients    = {{name|Fish|13}} {{name|item|#}} <- use the name template, then list the item and # of ingredient needed
+
    |season          = Spring, Summer, Fall, Winter, All
|edibility       = 20
+
    |growth          = 4 days
|sellprice       = 14
+
    |buff            = buff effects
|type            = fruit / vegetable
+
    |buffduration    = buff duration
|iridium        = true <- add iridium quality stars rating
+
    |craftingstation = <nowiki>{{name|Preserves Jar}}</nowiki> <- use the name template, then list the station name
|quality         = true / false / list of qualities to show
+
    |ingredients    = <nowiki>{{name|Fish|13}} {{name|item|#}}</nowiki> <- use the name template, then list the item and # of ingredient needed
|profession     = Rancher / Tiller / Artisan / Blacksmith / Forester / Tapper
+
    |recipe          = Source of recipe
|modifier        = Manual profession modifier
+
    |crafttime       = Crafting time
}}
+
    |image2          = Second image (deprecated - use multiple values in image instead)
</pre>
+
    |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
 +
    |artisanitem    = Name(s) of item(s) derived from primary item by processing
 +
    |artisanprofession = Professions that affect prices of artisanitems
 +
    |alt_artisanitem = Language-specific eqivalents for artisanitems
 +
    |artisanprice    = Base price of artisanitems
 +
    |artisanquality  = Qualities of artisanitems
 +
  <nowiki>}}</nowiki>
 +
 
 +
===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 <tt>page_name</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
 +
** 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 (<nowiki>&bullet;</nowiki>)
 +
 
 +
* '''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 (<nowiki>&bullet;</nowiki>)
 +
 
 +
* '''edibility = ''base_edibility'''''
 +
** Base edibility of the item, as extracted from [[Modding:Object data|ObjectInformation.xnb]]
 +
** See [[Template:Edibility]] for details
 +
** For inedible items, specify <tt>edibility=-300</tt> or <tt>edibility=inedible</tt>. 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 [[Modding:Object data|ObjectInformation.xnb]]
 +
** Use <tt>profession</tt> 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 <tt>Normal, Silver, Gold</tt>
 +
 
 +
* '''iridium = true'''
 +
** Set iridium to true to add <tt>Iridium</tt> to the list of qualities.
 +
** Easier to do by including Iridium as a value for <tt>quality</tt>; <tt>iridium</tt> 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: <tt>Spring, Summer, Fall, Winter, All Seasons</tt>
 +
** 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., <tt>growth=4 days</tt>
 +
 
 +
* '''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., <tt>craftingstation=<nowiki>{{name|Preserves Jar}}</nowiki></tt>
 +
 
 +
* '''ingredients = ''values'''''
 +
** List of all ingredients / source items necessary to produce this item
 +
** The [[Template:Name|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 <tt>image</tt>
 +
 
 +
* '''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 <tt>source</tt>
 +
** 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 <tt>crafttime</tt> parameter is "Processing Time" if true; "Time to Craft" if not
 +
 
 +
* '''eng = ''item_name'''''
 +
** English equivalent of <tt>name</tt>.  Only relevant on non-English wikis
 +
 
 +
* '''fishingxp = ''values'''''
 +
* See [[Green Algae]] for example of usage
 +
 
 +
* '''artisanitem = ''values''''', '''artisanprofession = ''values''''', '''alt_artisanitem = ''values''''', '''artisanprice = ''values''''', '''artisanquality=''values'''''
 +
** These parameters are all used to generate a grid of prices for items derived/created from the primary item.
 +
** They are all passed into [[Template:Infosection price]], which provides more complete documentation of their meaning
   −
==Samples==
+
===Examples===
<pre>
   
{{Infobox
 
{{Infobox
 
|name            = Corn
 
|name            = Corn
Line 59: Line 180:  
|profession      = Rancher,Blacksmith
 
|profession      = Rancher,Blacksmith
 
}}
 
}}
</pre>  
+
The code below generates the infobox shown to the right.
 
+
<pre>{{Infobox
Results in...
  −
{{Infobox
   
|name            = Corn
 
|name            = Corn
 
|image          = Corn.png
 
|image          = Corn.png
Line 76: Line 195:  
|profession      = Rancher,Blacksmith
 
|profession      = Rancher,Blacksmith
 
}}
 
}}
 +
</pre>
   −
<pre style="clear:both;">
+
{{clear}}
 
{{Infobox
 
{{Infobox
 
|name            = Corn
 
|name            = Corn
Line 92: Line 212:  
|edibility      = 10
 
|edibility      = 10
 
|sellprice      = 14
 
|sellprice      = 14
|iridium        = true
   
|profession      = Tapper
 
|profession      = Tapper
 
|quality        = false
 
|quality        = false
 
}}
 
}}
</pre>  
+
The code below generates the infobox shown to the right.
 
+
<pre>
Results in...
   
{{Infobox
 
{{Infobox
 
|name            = Corn
 
|name            = Corn
Line 113: Line 231:  
|edibility      = 10
 
|edibility      = 10
 
|sellprice      = 14
 
|sellprice      = 14
 +
|iridium        = true
 
|profession      = Tapper
 
|profession      = Tapper
 
|quality        = false
 
|quality        = false
}}<includeonly>[[Category:Infobox templates]]</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>
+
}}
<includeonly>{{Addlanglinks}}</includeonly>
+
</pre>
 +
<includeonly>[[Category:Infobox templates]]</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>