This page is semi-protected against editing.

Template:Other versions

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Other versions/doc.

[edit subpage]

This template in most cases is transcluded with one file, but it is able to display an unlimited number of files.
This template finally uses Template:F, which can be customized with many parameters.
Two kinds of parameters can be used for that customizing:

  1. global parameters, which are valid for each file, as long they are not suppressed or overriden by
  2. individual parameters, which are valid for only one of the files, whose number is specified.

A parameter is either specified (with a value), or not (when not coded, or without a value).
Specified global parameter values can be individually

  • kept valid, by not specifying an individual parameter
  • suppressed, with an individual value specified empty
  • overriden, by an individual value specified

An empty specified individual parameter for a not specified global parameter is useless but will not disturb;
an individual parameter with a number exceeding that of the specified files is useless but will not disturb.
Some parameters format the file display layout; when no display occurs, their specification is useless but will not disturb.

Display other files

Usage

{{Other versions |1= }}

Template parameters

ParameterDescriptionDefaultStatus
1File name of the image (with or without namespace).0optional
2, 3, ... nnames of more files; for each empty parameter, the name of parameter 1 is usedemptyoptional
labFFF or l
0l1 ... ln
(Global display label for files) normally not useful if more than 1 file
individual parameter(s)
emptyoptional
disFFF or dl
0d1 ... dn
Global pixel size value, to display the image. See also the parameter "z"
individual size parameter{s}
emptyoptional
optFFF or o
0o1 ... on
Global additional option for {{F}}, like "l" (left) or "b" (bordered)
individual option(s)
emptyoptional
par4FF or ql
0q1 ... qn
Global 4th parameter for {{F}}, like "n" (nolink) or "+" or "-"
individual more parameter(s)
emptyoptional
par5FF or rl
0r1 ... rn
Global 5th parameter for {{F}}
individual more parameter(s)
emptyoptional
wikiFF or kl
0k1 ... kn
Global ISO 639-1 code for a Wikipedia sisterproject
individual code parameter(s)
emptyoptional
interF or il
0i1 ... in
Global ISO 639-1 code for SVG switch internationalization
individual code parameter(s)
emptyoptional
pfxFFF or xl
0x1 ... xn
Global code prefixing the file
individual prefix parameter(s)
emptyoptional
t1 ... tnindividual postfix text parameter(s) (does not exist globally)emptyoptional
byFFFF or bl
0b1 ... bn
Global author name
individual author name(s)
emptyoptional
modFFF or ml
0m1 ... mn
Global code for modification of the user link(s)
individual modifications (as t, w, wt)
emptyoptional
conjFF or cspecify c[on[j]]=n to suppress the commas and the final 'and' in the listemptyoptional
varyFF or vla parameter list for variations is usedemptyoptional
v1FFF and v2lGlobal pre- and postfixes for variationsemptyoptional
spaFFF or sl
0s1 ... sn
Global code for an intermediate space for variations: "+" for a space, else none
individual codes
emptyoptional
galleryset to "yes" for a gallery layout: see {{G}} for gallery parameters
The characters for the individual parameter codes won't conflict with them for galleries.
emptyoptional

Additional information

The template is intended to be used in the following namespaces: no namespace specified

The template is intended to be used by the following user groups: no user group specified

See also

There are currently five templates creating file lists with the function:filelist of the Module:Iteration

  1. Other versions a vertical list (without initial)
  2. Derivative versions a vertical list
  3. Derived from a vertical list
  4. Filelist a horizontal list (without initial)
  5. File a horizontal list

All these templates are autoreferencing, and they support also the "gallery" option.


Example

{{ Other versionsa.pngb.png }} will give 0 A.png and B.png

{{ Other versionsa.pnge.png }} will give 0 A.png

{{ Other versionsa.pnge.png× }} will give 0 A.png

Abbrevition :

In simple cases the |by= can be abbreviated with /:
{{ Other versionsExample.jpg/Exampleexample.svg/Extra }}
renders as

Gallery

{{ Other versionsSolid cyan.svgSolid lime.svgSolid orange.svggallery = yesw = 60 }} will give 0

Pseudo filenames

Normally the parameters 1 ... n specify file names. Some special functions are performed with parameters not specifying real file names;
but all parameters are counted, regardless whether they are real filenames or not. With e.g. the pseude filename "×" at the last position the and can be converted to a ,.

Display text

When a parameter is specified starting and ending with " (" sign ") the text between the two quotes is displayed.

Variations

are a function for series of files with names differing only in one part, as it should be in well designed file systems; see the three examples below.
The variation option is triggered with the parameter "vary" or "v" specifying the pattern that should be replaced.

  • The first file name parameter is not a real file name, it contains the pattern which will be replaced by the following strings.
  • All the other file name parameters are not real file names but the strings replacing the pattern; an empty parameter just removes the pattern.

Specially for variations (but not only) the shortcut parmeter "z" is useful: it specifies the display size (like "d"),

and sets in addition the "o=Z" and "p= ", when they are not specified otherwise: a |p= specification overwrites the |z= option:

default OOjs UI icon alert-invert.svg OOjs UI icon alert.svg OOjs UI icon alert-constructive.svg OOjs UI icon alert-destructive.svg OOjs UI icon alert-progressive.svg OOjs UI icon alert-warning.svg OOjs UI icon alert-yellow.svg
p=­ ­OOjs UI icon alert-invert.svg­OOjs UI icon alert.svg­OOjs UI icon alert-constructive.svg­OOjs UI icon alert-destructive.svg­OOjs UI icon alert-progressive.svg­OOjs UI icon alert-warning.svg­OOjs UI icon alert-yellow.svg
p=   OOjs UI icon alert-invert.svgOOjs UI icon alert.svgOOjs UI icon alert-constructive.svgOOjs UI icon alert-destructive.svgOOjs UI icon alert-progressive.svgOOjs UI icon alert-warning.svgOOjs UI icon alert-yellow.svg

Variations: single replacements

Each parameter (except the first one) is combined with the first parameter to generate an existing filename.

Example: {{ Other versionsvary = ?z = 48Pictogram reply?.svg"Replies: "bluegreensoft green }}
  • Replies:
  • Pictogram reply blue.svg
  • Pictogram reply green.svg
  • Pictogram reply soft green.svg
  • Pictogram reply.svg

Variations: loop replacements

For series of files where the variated part is a number, it is possible to specify in one parameter the starting and the ending number, to generate all the file names - without any limit.
Loop replacements are specified with a parameter starting with a "#", followed by the first number, another "#" follwed by the second number and ending with another "#".
The second number (the upper limit) must not be less than the first number (the lower limit). When any error occurs, no looping is done.

Example: {{ Other versionsv = xxz = 20State Highway xx NZ.svg"1st: "#1#8#"  2nd: "#20#41#"  3rd: "#56#60# }}
  • 1st:
  • State Highway 1 NZ.svg
  • State Highway 2 NZ.svg
  • State Highway 3 NZ.svg
  • State Highway 4 NZ.svg
  • State Highway 5 NZ.svg
  • State Highway 6 NZ.svg
  • State Highway 7 NZ.svg
  • State Highway 8 NZ.svg  2nd:
  • State Highway 20 NZ.svg
  • State Highway 21 NZ.svg
  • State Highway 22 NZ.svg
  • State Highway 23 NZ.svg
  • State Highway 24 NZ.svg
  • State Highway 25 NZ.svg
  • State Highway 26 NZ.svg
  • State Highway 27 NZ.svg
  • State Highway 28 NZ.svg
  • State Highway 29 NZ.svg
  • State Highway 30 NZ.svg
  • State Highway 31 NZ.svg
  • State Highway 32 NZ.svg
  • State Highway 33 NZ.svg
  • State Highway 34 NZ.svg
  • State Highway 35 NZ.svg
  • State Highway 36 NZ.svg
  • State Highway 37 NZ.svg
  • State Highway 38 NZ.svg
  • State Highway 39 NZ.svg
  • State Highway 40 NZ.svg
  • State Highway 41 NZ.svg  3rd:
  • State Highway 56 NZ.svg
  • State Highway 57 NZ.svg
  • State Highway 58 NZ.svg
  • State Highway 59 NZ.svg
  • State Highway 60 NZ.svg

In such a way, hundreds of files can be displayed with few parameters, e.g. {{ Flv = #z = 12Bundesstraße # number.svg#1#113# }}
113 Bundesstraßen: Bundesstraße 1 number.svg Bundesstraße 2 number.svg Bundesstraße 3 number.svg Bundesstraße 4 number.svg Bundesstraße 5 number.svg Bundesstraße 6 number.svg Bundesstraße 7 number.svg Bundesstraße 8 number.svg Bundesstraße 9 number.svg Bundesstraße 10 number.svg Bundesstraße 11 number.svg Bundesstraße 12 number.svg Bundesstraße 13 number.svg Bundesstraße 14 number.svg Bundesstraße 15 number.svg Bundesstraße 16 number.svg Bundesstraße 17 number.svg Bundesstraße 18 number.svg Bundesstraße 19 number.svg Bundesstraße 20 number.svg Bundesstraße 21 number.svg Bundesstraße 22 number.svg Bundesstraße 23 number.svg Bundesstraße 24 number.svg Bundesstraße 25 number.svg Bundesstraße 26 number.svg Bundesstraße 27 number.svg Bundesstraße 28 number.svg Bundesstraße 29 number.svg Bundesstraße 30 number.svg Bundesstraße 31 number.svg Bundesstraße 32 number.svg Bundesstraße 33 number.svg Bundesstraße 34 number.svg Bundesstraße 35 number.svg Bundesstraße 36 number.svg Bundesstraße 37 number.svg Bundesstraße 38 number.svg Bundesstraße 39 number.svg Bundesstraße 40 number.svg Bundesstraße 41 number.svg Bundesstraße 42 number.svg Bundesstraße 43 number.svg Bundesstraße 44 number.svg Bundesstraße 45 number.svg Bundesstraße 46 number.svg Bundesstraße 47 number.svg Bundesstraße 48 number.svg Bundesstraße 49 number.svg Bundesstraße 50 number.svg Bundesstraße 51 number.svg Bundesstraße 52 number.svg Bundesstraße 53 number.svg Bundesstraße 54 number.svg Bundesstraße 55 number.svg Bundesstraße 56 number.svg Bundesstraße 57 number.svg Bundesstraße 58 number.svg Bundesstraße 59 number.svg Bundesstraße 60 number.svg Bundesstraße 61 number.svg Bundesstraße 62 number.svg Bundesstraße 63 number.svg Bundesstraße 64 number.svg Bundesstraße 65 number.svg Bundesstraße 66 number.svg Bundesstraße 67 number.svg Bundesstraße 68 number.svg Bundesstraße 69 number.svg Bundesstraße 70 number.svg Bundesstraße 71 number.svg Bundesstraße 72 number.svg Bundesstraße 73 number.svg Bundesstraße 74 number.svg Bundesstraße 75 number.svg Bundesstraße 76 number.svg Bundesstraße 77 number.svg Bundesstraße 78 number.svg Bundesstraße 79 number.svg Bundesstraße 80 number.svg Bundesstraße 81 number.svg Bundesstraße 82 number.svg Bundesstraße 83 number.svg Bundesstraße 84 number.svg Bundesstraße 85 number.svg Bundesstraße 86 number.svg Bundesstraße 87 number.svg Bundesstraße 88 number.svg Bundesstraße 89 number.svg Bundesstraße 90 number.svg Bundesstraße 91 number.svg Bundesstraße 92 number.svg Bundesstraße 93 number.svg Bundesstraße 94 number.svg Bundesstraße 95 number.svg Bundesstraße 96 number.svg Bundesstraße 97 number.svg Bundesstraße 98 number.svg Bundesstraße 99 number.svg Bundesstraße 100 number.svg Bundesstraße 101 number.svg Bundesstraße 102 number.svg Bundesstraße 103 number.svg Bundesstraße 104 number.svg Bundesstraße 105 number.svg Bundesstraße 106 number.svg Bundesstraße 107 number.svg Bundesstraße 108 number.svg Bundesstraße 109 number.svg Bundesstraße 110 number.svg Bundesstraße 111 number.svg Bundesstraße 112 number.svg Bundesstraße 113 number.svg