This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Template:Quality

From Stardew Valley Wiki
Jump to: navigation, search

This template displays an image with a superimposed quality star, i.e., a star colored to match the item's quality (Silver, Gold, Iridium).

Usage

Syntax

Basic usage:

{{Quality|item_name|quality}}

Complete argument list:

{{Quality|item_name|quality| size=px | link=link | alt=alt }}

Parameters

There are two unnamed, required parameters, item_name and quality. All other parameters are named and optional. Default value for all arguments is empty, unless specified otherwise.

  • item_name
    • First unnamed parameter, required
    • The name of an item, or more specifically the name of the image (without .png)
    • 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)
    • There is technically a default value, Blank_Icon, solely to make the template not generate errors in the default display on other languages.
    • The template will automatically handle certain language-specific images. Namely in French, Japanese, Spanish, and Portuguese, all 4 Milk icons will be replaced with language-appropriate ones (where the "M" for cow milk or "G" for goat milk are replaced with more appropriate letters). The coding intentionally avoids using the expensive ifexist parser function because this template is frequently used dozens of times on a page. As a result, only specific known cases are recognized.
  • quality
    • Second unnamed parameter, required
    • Possible values are Silver, Gold, Iridium. Not case-sensitive. All other values are ignored (i.e., no star is displayed). If missing, no star is displayed.
    • On other languages, the translated terms are also recognized.
  • size=px
    • Size of icons in pixels. Default value is 24.
    • Standard values are 24, 32, and 48. Other values will work, but the size of the overlay region is always one of the standard values (e.g., there may be extra white space around the image).
    • Only the number should be provided (do not append "px").[1]
    • For backwards compatibility, the size can also be provided as a third unnamed argument (e.g., {{Quality|Parsnip|Silver|24}}).
  • link=link
    • 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 (|link=|) disables the image link (clicking on the item does nothing).
  • alt=alt
    • 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.
    • Setting alt to an empty value (|alt=|) disables the alt text. Appropriate whenever image is immediately followed by item name to prevent name from being read twice in a row.

Examples

{{Quality|Parsnip|silver}}
Result:
Parsnip
Silver
{{Quality|Kale|Gold|32|link=Vegetables}}
Result:
Vegetables
Gold
{{Quality|Potato|size=32|link=}}
Result:
{{Quality|Milk|iridium|size=24|link=|alt=}}
Result:
Iridium

Technical Details

  1. Technically, the template will strip any extra "px" from a provided size, but this usage is not recommended.