Template:G/doc: Difference between revisions
More actions
m +explanation |
m +link |
||
| Line 5: | Line 5: | ||
|1d =(list of) file(s) to be displayed, can be in different [[#File list notations|notations]] | |1d =(list of) file(s) to be displayed, can be in different [[#File list notations|notations]] | ||
|1def = | |1def = | ||
|1stat = | |1stat =suggested | ||
|2 =f | |2 =f | ||
|2d =one of three values to specify the format, <code>0</code> or <code>1</code> or <code>2</code> | |2d =one of three values to specify the [[#The parameter "format"|format]], <code>0</code> or <code>1</code> or <code>2</code> | ||
|2aliases=format | |2aliases=format | ||
|2def =1 | |2def =1 | ||
| Line 35: | Line 35: | ||
|7 =a | |7 =a | ||
|7d =attribute | |7d =attribute, for definition of <tt>class=</tt> | ||
|7aliases=attr | |7aliases=attr | ||
|7stat =optional- | |7stat =optional- | ||
| Line 74: | Line 74: | ||
can specify one of three options how naming captions for the single files are displayed: | can specify one of three options how naming captions for the single files are displayed: | ||
#<li value="0"> no naming | #<li value="0"> no naming | ||
# naming with the "showfilename" option (<code>f=1</code> is also the default) | # naming with the "showfilename" option <!-- (<code>f=1</code> is also the default) --> | ||
# naming with the second value of parameter pairs | # naming with the second value of parameter pairs | ||
<div style="background-color:#cfc;width:52%;"><u>Note:</u> While options like "showfilename" or "mode=slideshow" are deprecated in namespaces as e.g. articles or galleries, they can be very useful in e.g. file descriptions, or talk pages.</div> | |||
== File list notations == | == File list notations == | ||
The list of the files for the gallery can be specified in the | The list of the files ("items") for the gallery can be specified in the notation | ||
;List 1: {{tle|T=G|file1.ext|file2.ext|...|file{{sub|n}}.ext|more parameters}} | ;List 1: {{tle|T=G|file1.ext|file2.ext|...|file{{sub|n}}.ext|more parameters}} | ||
or as a list separated by <u>mandatory linefeeds</u> | or as a list separated by <u>mandatory linefeeds</u> | ||
;List 2: {{tle|T=G|<br>file1.ext<br>file2.ext<br>...<br>file{{sub|n}}.ext<br>|more parameters}} | ;List 2: {{tle|T=G|<br>file1.ext<br>file2.ext<br>...<br>file{{sub|n}}.ext<br>|more parameters}} | ||
Also a mixture of both | Also a mixture of both notations is possible. | ||
<div style="background-color:#cfc;width:60%;">The file names ("items") are specified with unnamed parameters.<br> | <div style="background-color:#cfc;width:60%;">The file names ("items") are specified with unnamed parameters.<br> | ||
With <code>1=</code>, <code>2=</code>, <code>3=</code> up to <code>n=</code> an '''unlimited number''' of items can be specified.<br> | With <code>1=</code>, <code>2=</code>, <code>3=</code> up to <code>n=</code> an '''unlimited number''' of items can be specified.<br> | ||
Each unnamed parameter (p{{sub|1}} to p{{sub|∞}}) can contain an '''unlimited number''' of | Each unnamed parameter (p{{sub|1}} to p{{sub|∞}}) can contain an '''unlimited number''' of linefeed-separated items.</div> | ||
For <code>format=2</code> | For <code>format=2</code> ''parameter pairs'' of file + description must be specified: | ||
;List 3: {{tle|T=G|file1.ext|description1|file2.ext|description2|...|file{{sub|n}}.ext|description{{sub|n}}|p8=f|2|more parameters}} | ;List 3: {{tle|T=G|file1.ext|description1|file2.ext|description2|...|file{{sub|n}}.ext|description{{sub|n}}|p8=f|2|more parameters}} | ||
This format needs always parameter pairs, but the second parameter may be without value (just a pipe or an empty new line).<br> | This format needs always parameter pairs, but the second parameter may be without value (just a pipe or an empty new line).<br> | ||
When the description is empty, the name of the file is displayed instead. | When the description is empty, the name of the file is displayed instead. | ||
<div style="background-color:#cfc;width:76%;">For <code>format=2</code> care should be taken when defining the items; | <div style="background-color:#cfc;width:76%;">For <code>format=2</code> care should be taken when defining the items; | ||
it does not matter whether they are pipe-separated or | it does not matter whether they are pipe-separated or linefeed-separated, but ''file names'' are defined with item{{sub|1}}, item{{sub|3}}, item{{sub|5}}, ... while descriptions are defined with the corresponding item{{sub|2}}, item{{sub|4}}, item{{sub|6}}, ...<br> | ||
Description items can be specified empty, but file name items ought to contain a value.</div> | Description items can be specified empty, but file name items ought to contain a value.</div> | ||
== Examples == | == Examples == | ||
Shows different item notations an parametrizings. | |||
{| class="wikitable"}} | {| class="wikitable"}} | ||
|- | |- | ||
Revision as of 06:47, 14 October 2019
Such a gallery can contain one ore more (up to an unlimited number) files.
The display format is supported by several options.
Usage
{{G |1= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | (list of) file(s) to be displayed, can be in different notations | empty | suggested | |
fformat | one of three values to specify the format, 0 or 1 or 2 | 1 | optional | |
mmode | gallery mode, can be specified with t or traditionaln or nolines, p or packed,h or packed-hover, o or packed-overlay, s or slideshow when parameter format is not specified, nolines is defaulted | empty nolines | optional | |
ccaption | gallery caption | empty | optional | |
pperrow | pictures per row | empty | optional | |
sstyle | possible style attribute | empty | optional | |
aattr | attribute, for definition of class= | empty | optional | |
wwidths | width for the displays | empty | optional | |
hheights | height for the displays | empty | optional | |
ttext | e.g. "small" for lower text size | 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
The (reduced) Gallery Function of Template:{{F}}
Another solution: Template:{{Gallery}}
Localization
This template is not intended to be localized.
The parameter "format"
can specify one of three options how naming captions for the single files are displayed:
- no naming
- naming with the "showfilename" option
- naming with the second value of parameter pairs
File list notations
The list of the files ("items") for the gallery can be specified in the notation
- List 1
- {{ G | file1.ext | file2.ext | ... | filen.ext | more parameters }}
or as a list separated by mandatory linefeeds
- List 2
- {{ G |
file1.ext
file2.ext
...
filen.ext
| more parameters }}
Also a mixture of both notations is possible.
With 1=, 2=, 3= up to n= an unlimited number of items can be specified.
For format=2 parameter pairs of file + description must be specified:
- List 3
- {{ G | file1.ext | description1 | file2.ext | description2 | ... | filen.ext | descriptionn | f = 2 | more parameters }}
This format needs always parameter pairs, but the second parameter may be without value (just a pipe or an empty new line).
When the description is empty, the name of the file is displayed instead.
format=2 care should be taken when defining the items;
it does not matter whether they are pipe-separated or linefeed-separated, but file names are defined with item1, item3, item5, ... while descriptions are defined with the corresponding item2, item4, item6, ...
Examples
Shows different item notations an parametrizings.
| just one file without parameters {{G| Example.svg}} | |
| some files, without parameters {{G|Example ba.svg|Example de.svg|Example bn.svg|Example de.svg|Example en.svg|Example ru.svg|Example lt.svg|Example ro.svg|Example tr.svg}} | |
{{G|Day-template.svg
Emojione 1F642.svg
Emojione BW 1F642.svg
Laughing-smiley.svg
Noto Emoji Oreo 1f642.svg
Noto Emoji Pie 1f642.svg
Line-style-icons-happy.svg
Nuvola emoticon - happy.svg
|f=0|w=48|m=n}}
| |
{{G|Blue king.svg|Chess kgt45.svg
|Chess krt45.svg|Chess kyt45.svg
|Green king.svg|Red king.svg
|Yellow king.svg|Chess kdt45.svg
|f=0|w=80|p=4}}
| |
|
Some descriptions are missing Purple check.svg|purple
Olive green check.svg|olive
File:Yellow check.svg|yellow
Cornflower blue check.svg|blue
Black check.svg||White check.svg|white|Green check.svg|green
File:Red check.svg|
Orange check.svg|{{W|orange}}
Light green check.svg|green
|f=2|w=96}}
|
{{G|EU-section-with-A.svg|{{W|Austria}}|EU-section-with-BG.svg|{{W|Bulgaria}}|EU-section-with-CY.svg|{{W|Cyprus}}
|EU-section-with-CZ.svg|{{W|Czech}}|EU-section-with-D.svg|{{W|Germany}}|EU-section-with-DK.svg|{{W|Denmark}}
|EU-section-with-B.svg|{{W|Belgium}}|EU-section-with-EST.svg|{{W|Estonia}}|EU-section-with-FIN.svg|{{W|Finland}}
|EU-section-with-GR.svg|{{W|Greece}}|EU-section-with-IRL.svg|{{W|Irland}}|EU-section-with-SLO.svg|{{W|Slovenia}}|f=2|h=80|m=n|t=s}}
|