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:Autoimage

From Stardew Valley Wiki
Jump to: navigation, search

This is a utility function to display requested images, or else fill in a default image. It is intended for use within infobox templates.

Notes

  • This template will automatically replace an image with the language-specific version, if one exists. For example, on the French wiki, File:Milk_FR.png will automatically be displayed instead of File:Milk.png.
  • It is not intended for general use outside of infoboxes, in particular because it uses the relatively expensive template function ifexist (potentially twice per image in the list). It's only necessary in casesv where there is a chance an image doesn't exist (i.e., a default image name filled in from PAGENAME) or where there's a chance that a specified image will have a language-specific version that should be used in its place on other language wikis.

Usage

Syntax

Standard usage:

{{Autoimage | images | eng=item }}

Complete argument list:

{{Autoimage | images | eng=item | separator=space | option=option}}

Parameters

There is one optional unnamed argument (images). All other parameters are named and optional. Default value for all arguments is empty.

  • images
    • First unnamed parameter, optional
    • A comma-separated list of one or more image names.
    • If images is empty, a default value will be filled in. On the English wiki, the pagename ({{PAGENAME}}) will be used. On other language wikis, eng must be used to provide the english translation of the current pagename.
    • The template works best with png images, in which case the image names should be provided without the .png extension.
    • For any other type of image, the extension must be included
    • Full image links (e.g., [[File:Parsnip.png]]) will also work, but no image-existence checks are done, and any option is ignored.
  • eng = item
    • English translation of current pagename.
    • Only necessary on non-English wikis
  • separator = space
    • Any type of space characters that should be placed in between images, e.g., &#nbsp; or <br/>.
  • option = option
    • Any additional option(s) to apply to all images. For example, option=24px.
    • Multiple options can be provided, as long as {{!}} (instead of |) is used to separate them, e.g., 24px{{!}}center

Examples

{{Autoimage|Parsnip,Kale,Wheat|option=24px}}

Parsnip.pngKale.pngWheat.png

{{Autoimage|Red Cabbage,Cauliflower|separator=<br/>}}

Red Cabbage.png
Cauliflower.png

@{{Autoimage}}@

On this template page, Autoimage without any parameters generates nothing, because [[File:Autoimage.png]] is not a valid file name. Result: @@