Changes

Jump to navigation Jump to search
Document changes from last couple template edits
Line 2: Line 2:     
In order for the values to be calculated correctly, the input value should always be the item base cost.  If other factors should be included (e.g., professions that increase the price), those factors should be specified using the <tt>prof_mult</tt> parameter.
 
In order for the values to be calculated correctly, the input value should always be the item base cost.  If other factors should be included (e.g., professions that increase the price), those factors should be specified using the <tt>prof_mult</tt> parameter.
 +
 +
For variable price items (Wine, Juice, Pickles, Jelly, Roe, Aged Roe, Honey, etc.)<ref name="items"/>, this template also allows the item base price to be automatically calculated from the source item price.
    
Additionally, a sortkey is provided allowing correct sorting in tables where a column contains multiple instances of this template.
 
Additionally, a sortkey is provided allowing correct sorting in tables where a column contains multiple instances of this template.
Line 22: Line 24:     
  <nowiki>{{</nowiki>[[Template:Qualityprice|Qualityprice]] |''item_name''| ''base_cost'' | prof_mult=''mult'' | quality=''values''
 
  <nowiki>{{</nowiki>[[Template:Qualityprice|Qualityprice]] |''item_name''| ''base_cost'' | prof_mult=''mult'' | quality=''values''
                 | iridium=true | hide=''values'' | size=''px'' | link=''link''| alt=''alt'' <nowiki>}}</nowiki>
+
                | srcprice=''price'' | auto=true
 +
                 | iridium=true | hide=''values'' | size=''px'' | link=''link'' | alt=''alt'' <nowiki>}}</nowiki>
    
===Parameters===
 
===Parameters===
Line 30: Line 33:     
* '''''item_name'''''
 
* '''''item_name'''''
** First unnamed parameter, required
+
** First unnamed parameter, required.
 
** Name of item being displayed. There should be a corresponding image named <tt>File:item_name.png</tt>.
 
** Name of item being displayed. There should be a corresponding image named <tt>File:item_name.png</tt>.
** On non-english wikis this should normally be the '''english''' item_name, unless there's a language-specific image of the item, e.g., <tt>Large_Milk_FR</tt> should be used in French instead of <tt>Large_Milk</tt>. To provide the translated item name, see <tt>alt</tt>
+
** On non-english wikis this should normally be the '''english''' item_name.  Even if there is a language-specific item image (e.g., [[:File:Large Milk FR.png]] in French), it should not be necessary to alter the image name ([[Template:Quality]] automatically handles all variants of milk image names).
 +
** To provide the translated item name, see <tt>link</tt> and/or <tt>alt</tt>.
 
** Note that there must be no spaces following the item_name -- the "|" symbol must come immediately afterwards, or the template will fail (due to quirks of how mediawiki templates process arguments)
 
** Note that there must be no spaces following the item_name -- the "|" symbol must come immediately afterwards, or the template will fail (due to quirks of how mediawiki templates process arguments)
    
* '''''base_cost'''''
 
* '''''base_cost'''''
** Second unnamed parameter, rquired
+
** Second unnamed parameter.
** The base cost of the item
+
** Required unless <tt>srcprice</tt> and <tt>auto</tt> are specified AND the item is one whose price can be auto-calculated.<ref name="items"/>
 +
** The base cost of the displayed item.
 +
** Normally the base cost should be a numeric value (or valid numeric expression).  If a non-numeric cost is provided, it will be printed as-is for all requested qualities (and the sortkey is set to "0" to hide the non-numeric data from any table-sorting).
    
* '''prof_mult=''mult'''''
 
* '''prof_mult=''mult'''''
** Any other multipliers (e.g., profession price bonuses) that should be included in the calculated price.  Default value is 1
+
** Any other multipliers (e.g., profession price bonuses) that should be included in the calculated price.  Default value is 1.
 +
** This value is always ignored (<tt>prof_mult</tt> is forced to be 1) for Oil and Coffee, to ensure that the Artisan Profession bonus is not accidentally displayed for these items. This allows oil to be shown in multi-item infobox displays alongside other artisan goods without any special handling elsewhere.
    
* '''quality=''values'''''
 
* '''quality=''values'''''
Line 48: Line 55:  
** Set quality to one or more specific quality values
 
** Set quality to one or more specific quality values
 
** iridium is disabled by default. Enable by explicitly adding iridium to the listed quality values or by setting <tt>iridium=true</tt>
 
** iridium is disabled by default. Enable by explicitly adding iridium to the listed quality values or by setting <tt>iridium=true</tt>
 +
** If <tt>auto</tt> is set and the displayed item is recognized, any input quality value will be ignored and instead the quality will be automatically set based on the item's default allowed qualities.
 +
 +
* '''srcprice=''price'''''
 +
** The base price of the source item (e.g., vegetable, fruit, flower, or fish) used to create the displayed item.
 +
** Only relevant if <tt>auto</tt> is set, and the displayed item is one whose price depends upon the source item (Wine, Juice, Pickles, Jelly, Roe, Aged Roe, Honey, etc.)<ref name="items"/>.  In which case, the item base price will be automatically derived from <tt>srcrprice</tt>.
 +
** For example, to display the price of Salmonberry Wine, set <tt>srcrprice=5</tt>.
 +
 +
* '''auto=true'''
 +
** Set auto to true in order to allow quality and base_cost to be automatically set for recognized items.<ref name="items"/>
    
* '''iridium=true'''
 
* '''iridium=true'''
Line 63: Line 79:     
* '''link=''link'''''
 
* '''link=''link'''''
** Name of page (without square brackets) that item icon should link to. By default empty, meaning clicking on the icon does nothing.
+
** Name of page (without square brackets) that item icon should link to.
 +
** By default, link is automatically set to ''item_name''.
 +
** Setting link to an empty value (<tt>|link=|</tt>) disables the image link (clicking on the item does nothing).
    
* '''alt=''alt'''''
 
* '''alt=''alt'''''
** Alt text for item icon. Default value is ''link'' (if non-empty) or ''item_name''.
+
** Alt text for item icon. Default value is ''link'' or ''item_name''.
 
** This is not normally directly displayed on the page, but may be used by screen readers or accessibility-aware browsers.
 
** This is not normally directly displayed on the page, but may be used by screen readers or accessibility-aware browsers.
 +
** Setting alt to an empty value (<tt>|alt=|</tt>) disables the alt text.
    
===Examples===
 
===Examples===
Line 76: Line 95:     
<pre>
 
<pre>
{{Qualityprice|Pumpkin|100|prof_mult=1.1}}
+
{{Qualityprice|Pumpkin|100|prof_mult=1.1|link=Vegetables}}
 
</pre>
 
</pre>
{{Qualityprice|Pumpkin|100|prof_mult=1.1}}
+
{{Qualityprice|Pumpkin|100|prof_mult=1.1|link=Vegetables}}
    
<pre>
 
<pre>
{{Qualityprice|Leek|60|iridium}}
+
{{Qualityprice|Leek|60|iridium|link=}}
 
</pre>
 
</pre>
{{Qualityprice|Leek|60|iridium}}
+
{{Qualityprice|Leek|60|iridium|link=}}
    
<pre>
 
<pre>
Line 94: Line 113:  
</pre>
 
</pre>
 
{{Qualityprice|Apple|42|iridium|hide=silver,iridium}}
 
{{Qualityprice|Apple|42|iridium|hide=silver,iridium}}
 +
 +
<pre>
 +
{{Qualityprice|Wine|auto=true|srcprice=42|prof_mult=1.4}}
 +
</pre>
 +
{{Qualityprice|Wine|auto=true|srcprice=42|prof_mult=1.4}}
 +
 +
==References==
 +
<references>
 +
<ref name="items">The full list of items for which the quality and base price can be automatically set is: Wine, Juice, Jelly, Pickles, Honey, Roe, Caviar, Aged Roe, Pale Ale, Beer, and Mead. A few fixed-price items are included in this list so multiple-item infobox displays can be handled more easily.</ref>
 +
<references/>
    
<includeonly>[[Category:Formatting templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
 
<includeonly>[[Category:Formatting templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>

Navigation menu