Template:G/doc: Difference between revisions
More actions
m first version |
m format |
||
| Line 6: | Line 6: | ||
|1stat =optional-<!-- suggested --> | |1stat =optional-<!-- suggested --> | ||
|2 = | |2 =f | ||
|2d =one of three values, <code>0</code> or <code>1</code> or <code>2</code> | |2d =one of three values to specify the format, <code>0</code> or <code>1</code> or <code>2</code> | ||
|2aliases= | |2aliases=format | ||
|2def =1 | |2def =1 | ||
|2stat =optional- | |2stat =optional- | ||
| | |3 =m | ||
| | |3d =gallery mode, can be <br><code>n</code> or <tt>nolines</tt>, <br><code>p</code> or <tt>packed</tt>,<br><code>h</code> or <tt>packed-hover</tt>, <br><code>o</code> or <tt>packed-overlay</tt>, <br><code>s</code> or <tt>slideshow</tt><br>when parameter <code>format</code> is not specified, <code>nolines</code> ist defaulted | ||
| | |3aliases=mode | ||
| | |3def =empty<br>noline | ||
|3stat =optional- | |||
|4 =c | |||
|4d =gallery caption | |||
|4aliases=caption | |||
|4stat =optional- | |4stat =optional- | ||
|5 = | |5 =p | ||
|5d = | |5d =pictures <tt>per row</tt> | ||
|5aliases= | |5aliases=perrow | ||
|5stat =optional- | |5stat =optional- | ||
|6 = | |6 =s | ||
|6d = | |6d =possible style attribute | ||
|6aliases= | |6aliases=style | ||
|6stat =optional- | |6stat =optional- | ||
|7 = | |7 =a | ||
|7d = | |7d =attribute (class) | ||
|7aliases= | |7aliases=attr class | ||
|7stat =optional- | |7stat =optional- | ||
| Line 58: | Line 63: | ||
|relieson= | |relieson= | ||
}} | }} | ||
== The parameter "format" == | |||
can specify one of three options how naming captions for the single files are displayed: | |||
#<li value="0"> no naming | |||
# naming with the "showfilename" option (<code>f=1</code> is also the default) | |||
# naming with the second value of parameter pairs | |||
== File list formats == | == File list formats == | ||
| Line 64: | Line 75: | ||
or as a list separated by <u>mandatory linefeeds</u> | or as a list separated by <u>mandatory linefeeds</u> | ||
;Fomat 2: {{tle|T=G|<br>file1.ext<br>file2.ext<br>...<br>file{{sub|n}}.ext<br>|more parameters}} | ;Fomat 2: {{tle|T=G|<br>file1.ext<br>file2.ext<br>...<br>file{{sub|n}}.ext<br>|more parameters}} | ||
Also a mixture of both formats is possible. | |||
For <code>format=2</code> only a variation of the first format ist possible, with ''parameter pairs'' of file + decription | |||
For <code> | ;Fomat 3: {{tle|T=G|file1.ext|description1|file2.ext|description2|...|file{{sub|n}}.ext|description{{sub|n}}|p8=f|2|more parameters}} | ||
;Fomat 3: {{tle|T=G|file1.ext|description1|file2.ext|description2|...|file{{sub|n}}.ext|description{{sub|n}}|p8= | This format needs always parameter pairs, but the second parameter may be without value (just a pipe or a new line).<br> | ||
When the description is empty, the | When the description is empty, the name of the file is displayed instead. | ||
== Examples == | == Examples == | ||
xxx | |||
{{G|Example.svg|w=64|a="float-left"|f=|m=n}} <nowiki>{{G|Example.svg|w=64|s=float-left}}</nowiki> | |||
Revision as of 14:04, 13 October 2019
Displays a gallery of files
Usage
{{G}}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 ... | (list of) file(s) to be displayed, can be in two possible formats | empty | optional | |
fformat | one of three values to specify the format, 0 or 1 or 2 | 1 | optional | |
mmode | gallery mode, can be n or nolines, p or packed,h or packed-hover, o or packed-overlay, s or slideshowwhen parameter format is not specified, nolines ist defaulted | empty noline | optional | |
ccaption | gallery caption | empty | optional | |
pperrow | pictures per row | empty | optional | |
sstyle | possible style attribute | empty | optional | |
aattr class | attribute (class) | empty | optional | |
wwidths | width for the displays | empty | optional | |
hheights | height for the displays | 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
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 (
f=1is also the default) - naming with the second value of parameter pairs
File list formats
The list of the files for the gallery can be specified in the format
- Fomat 1
- {{ G | file1.ext | file2.ext | ... | filen.ext | more parameters }}
or as a list separated by mandatory linefeeds
- Fomat 2
- {{ G |
file1.ext
file2.ext
...
filen.ext
| more parameters }}
Also a mixture of both formats is possible.
For format=2 only a variation of the first format ist possible, with parameter pairs of file + decription
- Fomat 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 a new line).
When the description is empty, the name of the file is displayed instead.
Examples
xxx
{{G|Example.svg|w=64|s=float-left}}