Template:F/doc: Difference between revisions
More actions
m +pic |
m expansion (lang-switch) |
||
| Line 7: | Line 7: | ||
|3=3 | |3=3 | ||
|3d=pixel size: numeric value. The picture is displayed inline in this size <ref name="a">It is ''not possible'' to display images of other Wikipedias - only when the files are stored in the Commons</ref> | |3d=pixel size: numeric value. The picture is displayed inline in this size <ref name="a">It is ''not possible'' to display images of other Wikipedias - only when the files are stored in the Commons</ref> | ||
|4=4 | |4=4 | ||
|4d='''b'''<ref name="b">Any of these parameter values (b, l, n, s) can be passed in any sequence, each as an argument for one of the parameters either #4, #5, #6 or #7: <tt><nowiki>{{F|X.jpg||16|b|l|n|s}}</nowiki></tt> is equivalent to <tt><nowiki>{{F|X.jpg||16|l|s|n|b}}</nowiki></tt>. "n" or "s" may even be coded at the position of par #3 when no pixel size is specified there.</ref> (lowercase B) ''to draw a '''''b'''order'' around the displayed picture'' | |4d='''b'''<ref name="b">Any of these parameter values (b, l, n, s) can be passed in any sequence, each as an argument for one of the parameters either #4, #5, #6 or #7: <tt><nowiki>{{F|X.jpg||16|b|l|n|s}}</nowiki></tt> is equivalent to <tt><nowiki>{{F|X.jpg||16|l|s|n|b}}</nowiki></tt>. "n" or "s" may even be coded at the position of par #3 when no pixel size is specified there.</ref> (lowercase B) ''to draw a '''''b'''order'' around the displayed picture'' | ||
| Line 22: | Line 19: | ||
|7d='''s'''<ref name="b" /> (lowercase S) ''to display the file's '''s'''ize'' (.... bytes) - [http://www.mediawiki.org/wiki/Extension:MediaFunctions not yet valid] | |7d='''s'''<ref name="b" /> (lowercase S) ''to display the file's '''s'''ize'' (.... bytes) - [http://www.mediawiki.org/wiki/Extension:MediaFunctions not yet valid] | ||
|7stat=optional- | |7stat=optional- | ||
|8=l | |||
|8d=language code ({{W|ISO 639-1|ISO 639}}), if the file is in another Wikipedia <ref name="a" /><br /><!--This parameter -->may specify e.g. "l=b:es" for an image of the {{W||Spanish Wikibooks|b:es}},<br>or e.g. "l=s:it" for image {{F|Pallot1.svg|l=s:it}} in {{W||Italian Wikisource|s:it}} | |||
|8stat=optional- | |||
|9=lang | |||
|9d=language code ({{W|ISO 639-1|ISO 639}}), if the file contains translation using SVG <switch> elements. | |||
|9stat=optional- | |||
|name=Template:F | |name=Template:F | ||
|desc=<big>Establishes a link to the file whose name is given in par #1 and displays the name without the prefix "File:".</big><br /> | |desc=<big>Establishes a link to the file whose name is given in par #1 and displays the name without the prefix "File:".</big><br /> | ||
| Line 55: | Line 60: | ||
|<nowiki>{{F|$!.png|3=s}}</nowiki> || {{F|$!.png|3=s}} || #mediasize <small>(of the ''description page''!)</small><!--{{#mediasize:File:$!.png}}--> | |<nowiki>{{F|$!.png|3=s}}</nowiki> || {{F|$!.png|3=s}} || #mediasize <small>(of the ''description page''!)</small><!--{{#mediasize:File:$!.png}}--> | ||
|} | |} | ||
== Language switch == | |||
The file {{F|France Population Pyramid-2010.svg}} contains may languages. With <nowiki>{{</nowiki>F|France Population Pyramid-2010.svg | | 160 | lang=''xx''}} the translated versions can be shown:<br> | |||
{{F|France Population Pyramid-2010.svg|arabic:|160|lang=ar}} {{0|000}} {{F|France Population Pyramid-2010.svg|ivrit:|160|lang=he}} {{0|000}} {{F|France Population Pyramid-2010.svg|korean:|160|lang=ko}} {{0|000}} {{F|France Population Pyramid-2010.svg|japan:|160|lang=ja}} {{0|000}} {{F|France Population Pyramid-2010.svg|kyril:|160|lang=ru}} | |||
== Notes == | == Notes == | ||
<references /> | <references /> | ||
Revision as of 18:18, 4 December 2014
Establishes a link to the file whose name is given in par #1 and displays the name without the prefix "File:".
Additional possibilities:
- If par #1 is empty, the default will be no name.
- Instead of the file name, another name given in par #2 can be displayed.
- It is possible to avoid the link and display only the name of par #1 (or par #2).
- The file itself (the image) can be displayed at any size inline after the name (or left of it).
- The displayed image can be surrounded by a border.
- The size of the file can be displayed.
Usage
{{Template:F |1= |2= |3= }}
The parameters "n" and "l" allow better formatting, e.g. to get equal-wide rows when arranging several lines with displayed images — see the two examples.
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | file name: name of the file, without "File:", with extension | empty | optional | |
2 | display name: any text. Default is the file name (par #1) | empty | optional | |
3 | pixel size: numeric value. The picture is displayed inline in this size [1] | empty | optional | |
4 | b[2] (lowercase B) to draw a border around the displayed picture | empty | optional | |
5 | l[2] (lowercase L) to display the image left of the file name | empty | optional | |
6 | n[2] (lowercase N) to display the name not-linking to the file | empty | optional | |
7 | s[2] (lowercase S) to display the file's size (.... bytes) - not yet valid | empty | optional | |
l | language code (ISO 639), if the file is in another Wikipedia [1] may specify e.g. "l=b:es" for an image of the Spanish Wikibooks, or e.g. "l=s:it" for image Pallot1.svg in Italian Wikisource | empty | optional | |
lang | language code (ISO 639), if the file contains translation using SVG <switch> elements. | empty | optional | |
Additional information
The template is intended to be used in the following namespaces: the File namespace
The template is intended to be used by the following user groups: all users
See also
{{File|…}}
Examples
Buddhist flag: —
Buddhist flag (bordered)
| {{F}} | no name | without any parameter |
| {{F|Yes check.svg}} | Yes check.svg | only link |
| {{F|Yes check.svg||n}} | Yes check.svg | only name |
| {{F|Yes check.svg||16|n}} | Yes check.svg: |
no link (as in "other versions" of File:Arrow-C.svg.) |
| {{F|Yes check.svg||16|b}} | Yes check.svg: |
bordered |
| {{F|Yes_check.svg||16|l}} | left of name (as in "other versions" of File:Symbol unrelated.svg.) | |
| {{F|$!.png|3=s}} | 38480 | #mediasize (of the description page!) |
Language switch
The file France Population Pyramid-2010.svg contains may languages. With {{F|France Population Pyramid-2010.svg | | 160 | lang=xx}} the translated versions can be shown:
arabic:: ivrit::
korean::
japan::
kyril::
Notes
- ↑ 1.0 1.1 It is not possible to display images of other Wikipedias - only when the files are stored in the Commons
- ↑ 2.0 2.1 2.2 2.3 Any of these parameter values (b, l, n, s) can be passed in any sequence, each as an argument for one of the parameters either #4, #5, #6 or #7: {{F|X.jpg||16|b|l|n|s}} is equivalent to {{F|X.jpg||16|l|s|n|b}}. "n" or "s" may even be coded at the position of par #3 when no pixel size is specified there.