FANDOM


This template was created in response to Thread:1640832 and also applies to [[]]. This page is under construction

This template is meant to simplify the process of using Vignette to hotlink and optionally crop/resize images from the local wiki.

ParametersEdit

Specifying the WikiEdit

The template should be able to access images from any wiki on the FANDOM network (i.e. fandom.com or wikia.org). The template will assume the local wiki if both the "domain" and "language" parameters are omitted (or set to whitespace).

  • domain
    • domain (lower-case) of the target wiki
    • defaults to the local wiki as extracted from "{{SERVERNAME}}"
    • NOTE: Target wikis that have been moved (i.e. have had the URL changed) may require use of a previous domain.
  • language
    • language code (lower-case) of the target wiki
    • defaults to the language of the local wiki as extracted from "{{CONTENTLANGUAGE}}"
  • language subdomains
    • prepends the language code to the domain as a subdomain
    • to enable, provide a non-whitespace value
    • acts regardless of the "keep subdomains" option
    • NOTE: This option should not be needed for most target wikis. However, the image server still uses the old method of handling different language versions for some older wikis. If the target wiki is one of those wikis, then this option must be enabled for image retrieval to work.
  • keep subdomains
    • prevents the stripping of subdomains from the "domain" parameter
    • to enable, provide a non-whitespace value
    • NOTE: Due to the current domain structure used by Wikia, this parameter should not be needed. However, it has been provided just in case.

Specifying the ImageEdit

  • image - required
    • name (case-sensitive) of the image including the file extension
    • NOTE: If not provided, an error message will be displayed on the page.
  • replaced
    • timestamp of when the desired version was replaced (i.e. when the next version was uploaded) in the form YYYYMMDDhhmmss
    • leave blank if latest version is desired
  • code
    • two-character hexadecimal code (lower-case) assigned to the image
    • required if the target wiki is not the local wiki
    • characters beyond the first two are ignored
    • NOTE: Although this code is not random, the template is not capable of calculating it.
    • NOTE: If this parameter is not provided, the template will assume the local wiki regardless of the values provided for the "domain" and "language" parameters.

Specifying Image ModificationEdit

Vignette offers a variety of ways to modify the image. Depending on which mode is used, different parameters are required. If required parameters are missing, the template will disregard the corresponding modification.

  • mode
    • type of modification to perform
    • to produce the original image, omit this parameter or provide an unrecognized value
    • recognized values:
      1. width
        • scales to match the "width" parameter
        • required parameters: width
      2. height
        • scales to match the "height" parameter
        • required parameters: height
      3. max
        • scales like either "width" mode or "height" mode, whichever produces the smallest image
        • required parameters: width, height
      4. set
        • fixes the dimensions of the output image by padding where needed
        • scales like "max" mode
        • required parameters: width, height
      5. crop
        • crops the image before scaling
        • required parameters: position
  • position
    • location of cropped region relative to the original image
    • recognized values:
      1. center
        • crops width if specified aspect ratio is smaller than original aspect ratio
        • crops height if specified aspect ratio is larger than original aspect ratio
        • cropped region is centered horizontally and vertically
        • required parameters: width, height
      2. top
        • crops like "center" position
        • cropped region is centered horizontally
        • cropped region's top edge is aligned to the top edge
        • required parameters: width, height
      3. custom
        • crops specified window
        • scales cropped region like either "width" mode or "set" mode depending on the "fixed" parameter
        • required parameters: width, window width, window height
    • NOTE: Providing an unrecognized value will result in the original image.
  • width - target width of the output image
  • height - target height of the output image
  • upscale
    • allows the dimensions of the output image to exceed those of the original image
    • to enable, provide a non-whitespace value
    • not available for "height" mode and "custom" position
  • x offset
    • horizontal location of cropped region's left edge
    • defaults to 0
    • used by "custom" position only
  • y offset
    • vertical location of cropped region's top edge
    • defaults to 0
    • used by "custom" position only
  • window width
    • width of cropped region
    • used by "custom" position only
  • window height
    • height of cropped region
    • used by "custom" position only
  • fixed
    • fixes the dimensions of the output image by padding where needed
    • to enable, provide a non-whitespace value
    • required parameters: height
    • used by "custom" position only
  • fill
    • color to use for padding
    • defaults to white
    • must be a recognized color name

OtherEdit

  • link
    • target page the image will link to
    • behaves like the "link" parameter from the standard image syntax
      • supports internal, interwiki, and external links
      • defaults to original image's URL
      • to disable, provide a whitespace value
  • query
    • additional query string portion to append
    • do not include a leading "&"
  • error
    • content to display when the "image" parameter is not provided
    • defaults to: Template error: An image has not been specified.
    • to "disable", set as an empty string

ExamplesEdit

{{/Template|image=Wiki-wordmark.png}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|link=}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|link=mw:Help:Images}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|replaced=20180206165044}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|mode=width|width=100}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|mode=width|width=500}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|mode=width|width=500|upscale=y}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|mode=crop|position=center|width=100|height=45}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|mode=crop|position=custom|width=150|x offset=30|y offset=15|window width=50|window height=50}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|mode=crop|position=custom|width=150|x offset=30|y offset=15|window width=50|window height=50|fixed=y|height=50}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|mode=crop|position=custom|width=150|x offset=30|y offset=15|window width=50|window height=50|fixed=y|height=50|fill=orange}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|domain=starwars|code=89}}

Wiki-wordmark.png

{{/Template|image=Wiki-wordmark.png|domain=starwars|code=89|language=nl}}

Wiki-wordmark.png

Community content is available under CC-BY-SA unless otherwise noted.