User:Andrewds1021/Hotlink Vignette

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.

Specifying the Wiki
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 " "
 * 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 " "
 * 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 Image

 * 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 Modification
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:
 * width
 * scales to match the "width" parameter
 * required parameters: width
 * height
 * scales to match the "height" parameter
 * required parameters: height
 * max
 * scales like either "width" mode or "height" mode, whichever produces the smallest image
 * required parameters: width, height
 * set
 * fixes the dimensions of the output image by padding where needed
 * scales like "max" mode
 * required parameters: width, height
 * crop
 * crops the image before scaling
 * required parameters: position
 * position
 * location of cropped region relative to the original image
 * recognized values:
 * 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
 * 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
 * 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

Other

 * 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