Template:G/doc: Difference between revisions
More actions
disabled |
m Fix Linter errors. |
||
| Line 8: | Line 8: | ||
|2 =f | |2 =f | ||
|2d =one of the six numbers to specify the [[#The parameter "format"|⇒ format]]: <code>0</code> to <code>5</code><br> | |2d =one of the six numbers to specify the [[#The parameter "format"|⇒ format]]: <code>0</code> to <code>5</code><br /> | ||
whether or how the displayed image(s) should be captioned | whether or how the displayed image(s) should be captioned | ||
|2aliases=format | |2aliases=format | ||
| Line 15: | Line 15: | ||
|3 =m | |3 =m | ||
|3d =gallery mode, can be specified with <br>{{T\|<code>t</code>}} or {{T\|traditional}}<br>{{T\|<code>n</code>}} or {{T\|nolines}}, <br>{{T\|<code>p</code>}} or {{T\|packed}},<br>{{T\|<code>h</code>}} or {{T\|packed-hover}}, <br>{{T\|<code>o</code>}} or {{T\|packed-overlay}}, <br>{{T\|<code>s</code>}} or {{T\|slideshow}} <br>when parameter <code>format</code> is not specified, <code>nolines</code> is defaulted,<br>but that defaulting can be avoided with an empty mode parameter <code>m=</code> | |3d =gallery mode, can be specified with <br />{{T\|<code>t</code>}} or {{T\|traditional}}<br />{{T\|<code>n</code>}} or {{T\|nolines}}, <br />{{T\|<code>p</code>}} or {{T\|packed}},<br />{{T\|<code>h</code>}} or {{T\|packed-hover}}, <br />{{T\|<code>o</code>}} or {{T\|packed-overlay}}, <br />{{T\|<code>s</code>}} or {{T\|slideshow}} <br />when parameter <code>format</code> is not specified, <code>nolines</code> is defaulted,<br />but that defaulting can be avoided with an empty mode parameter <code>m=</code> | ||
|3aliases=mode | |3aliases=mode | ||
|3def =<br><br><br><span style="color:#777;font-variant:small-caps">empty</span><br><br><br><br><br>nolines | |3def =<br /><br /><br /><span style="color:#777;font-variant:small-caps">empty</span><br /><br /><br /><br /><br />nolines | ||
|3stat =optional- | |3stat =optional- | ||
|4 =c | |4 =c | ||
|4d =gallery caption <small>(may be shifted to the left with e.g. some trailing < | |4d =gallery caption <small>(may be shifted to the left with e.g. some trailing <code>&emsp;</code> entities)</small> | ||
|4aliases=caption | |4aliases=caption | ||
|4stat =optional- | |4stat =optional- | ||
| Line 36: | Line 36: | ||
|7 =a | |7 =a | ||
|7d =class attributes: any wikimedia class; <br>or the special code "c" (<code>a=c</code>) for a global < | |7d =class attributes: any wikimedia class; <br />or the special code "c" (<code>a=c</code>) for a global <code><nowiki><center></nowiki></code> tag | ||
|7aliases=attr, class | |7aliases=attr, class | ||
|7stat =optional- | |7stat =optional- | ||
| Line 51: | Line 51: | ||
|10 =d | |10 =d | ||
|10d =display size; can specify < | |10d =display size; can specify <code>widths</code> ''and'' <code>heights</code> | ||
|10aliases=display | |10aliases=display | ||
|10stat =optional- | |10stat =optional- | ||
| Line 66: | Line 66: | ||
|name={{BASEPAGENAME}} | |name={{BASEPAGENAME}} | ||
|desc-en={{Lua|Module:Galeria}}Displays a gallery of files, {{Nobold|using just the conventional < | |desc-en={{Lua|Module:Galeria}}Displays a gallery of files, {{Nobold|using just the conventional <code><nowiki><gallery></nowiki></code> tag,<br />but with shorter parametrizing and some useful defaults.}} | ||
<div style="float:left;padding-right:2em;width:24%">{{Nobold|__TOC__}}</div><br><br>{{Nobold|Such a gallery can contain one file or more, up to an unlimited number:}}<br><br> | <div style="float:left;padding-right:2em;width:24%">{{Nobold|__TOC__}}</div><br /><br />{{Nobold|Such a gallery can contain one file or more, up to an unlimited number:}}<br /><br /> | ||
* {{Nobold|with just {{Tle|T=G|filename}} a 'gallery' of a single file can be shown,}}<br><br> | * {{Nobold|with just {{Tle|T=G|filename}} a 'gallery' of a single file can be shown,}}<br /><br /> | ||
* {{Nobold|with e.g. {{Tle|T=G|filename1|filename2| ... }} more files are displayed.}}<br><br> | * {{Nobold|with e.g. {{Tle|T=G|filename1|filename2| ... }} more files are displayed.}}<br /><br /> | ||
{{Nobold|The display format can be influenced by several additional options.}} | {{Nobold|The display format can be influenced by several additional options.}} | ||
| Line 80: | Line 80: | ||
|i18n-method=- | |i18n-method=- | ||
|i18n-desc= | |i18n-desc= | ||
|seealso=The (reduced) [[Template:F#Gallery_style|Gallery Function]] of {{T|F|-}}<br>Another solution: {{T|Gallery|-}} and {{T|Gallery items}}<br> | |seealso=The (reduced) [[Template:F#Gallery_style|Gallery Function]] of {{T|F|-}}<br />Another solution: {{T|Gallery|-}} and {{T|Gallery items}}<br /> | ||
On meta: [[m:Help:Images and other uploaded files#Gallery]]<div style="background-color:#dfd;width:60%;"> | On meta: [[m:Help:Images and other uploaded files#Gallery]]<div style="background-color:#dfd;width:60%;"> | ||
Some {{C|Lua-based iteration templates}} have an option to invoke the gallery function; mainly the templates<br>{{T0|Derivative versions}} and {{T0|Other versions}}, as well as {{T0|Filelist}} and {{T0|File}} can invoke either one of {{M|Iteration}} or {{M|Galeria}}.<br> | Some {{C|Lua-based iteration templates}} have an option to invoke the gallery function; mainly the templates<br />{{T0|Derivative versions}} and {{T0|Other versions}}, as well as {{T0|Filelist}} and {{T0|File}} can invoke either one of {{M|Iteration}} or {{M|Galeria}}.<br /> | ||
For easy switching between both modules, their shortcode character parameters [[Module talk:Galeria/doc|won't conflict]].</div><br> | For easy switching between both modules, their shortcode character parameters [[Module talk:Galeria/doc|won't conflict]].</div><br /> | ||
But for the language gallery of a '''multi-language file''', use one of | But for the language gallery of a '''multi-language file''', use one of | ||
| Line 96: | Line 96: | ||
== The parameter "w", "d", "h" == | == The parameter "w", "d", "h" == | ||
The display size can be specified with either <code>widths</code> and/or <code>heights</code>, or with <code>display</code>.<br> | The display size can be specified with either <code>widths</code> and/or <code>heights</code>, or with <code>display</code>.<br /> | ||
While "w" and "h" can specify the number of the pixels, "d" consists of three optional parts: [w] [< | While "w" and "h" can specify the number of the pixels, "d" consists of three optional parts: [w] [<code>x</code>h] [px].<br /> | ||
"w" and/or "h" have ''precedence'': "d" is only checked when neither "w" nor "h" are specified. | "w" and/or "h" have ''precedence'': "d" is only checked when neither "w" nor "h" are specified. | ||
| Line 112: | Line 112: | ||
=== Defaulting the "format" === | === Defaulting the "format" === | ||
This parameter is a necessary addition to the parameters used by <code><nowiki><gallery></nowiki></code>.<br> | This parameter is a necessary addition to the parameters used by <code><nowiki><gallery></nowiki></code>.<br /> | ||
When the most frequent invocation form for <nowiki><gallery></nowiki> is used, i.e. | When the most frequent invocation form for <nowiki><gallery></nowiki> is used, i.e. | ||
* the first parameter is preceded by a linefeed, | * the first parameter is preceded by a linefeed, | ||
| Line 118: | Line 118: | ||
::* ''and'' it is separated from the first one by a pipe, | ::* ''and'' it is separated from the first one by a pipe, | ||
:::* ''and'' it does ''not also'' end with a <code>.</code> and file extension | :::* ''and'' it does ''not also'' end with a <code>.</code> and file extension | ||
then ''no format must be specified'', "'''<code>f=2</code>'''" is assumed, and<br> | then ''no format must be specified'', "'''<code>f=2</code>'''" is assumed, and<br /> | ||
the display with <nowiki>{{G| ... }}</nowiki> is the almost same as with <nowiki><gallery> ... </gallery></nowiki>.<br> | the display with <nowiki>{{G| ... }}</nowiki> is the almost same as with <nowiki><gallery> ... </gallery></nowiki>.<br /> | ||
When not all these requirements are fulfilled, the parameter needs to be specified!<br> | When not all these requirements are fulfilled, the parameter needs to be specified!<br /> | ||
Otherwise a missing format parameter is defaulted with "'''<code>f=1</code>'''". | Otherwise a missing format parameter is defaulted with "'''<code>f=1</code>'''". | ||
<div style="background-color:#fe9;width:52%">{{0|MWMWMWM}}<u>Be aware:</u> There are other valid possibilities to specify the parameters; | <div style="background-color:#fe9;width:52%">{{0|MWMWMWM}}<u>Be aware:</u> There are other valid possibilities to specify the parameters; | ||
| Line 129: | Line 129: | ||
;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 notations is possible. | 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 linefeed-separated items.<br> | Each unnamed parameter (p{{sub|1}} to p{{sub|∞}}) can contain an '''unlimited number''' of linefeed-separated items.<br /> | ||
(See also the [[Template talk:G#Item separation|overview]]). </div> | (See also the [[Template talk:G#Item separation|overview]]). </div> | ||
For <code>format=2</code> ''parameter pairs'' of file + description must be specified: | 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 description may be without value (just a pipe or an empty new line).<br> | This format needs always parameter pairs, but the description 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; but a description as e.g. < | When the description is empty, the name of the file is displayed instead; but a description as e.g. <code>&nbsp;</code> will be used! | ||
<div style="background-color:#cfc;width:60%;">For <code>format=2</code> care should be taken when defining the items; it does not matter <br>whether they are pipe-separated or linefeed-separated, but ''file names'' are defined with item{{sub|1}}, item{{sub|3}}, item{{sub|5}}, ... <br>while the descriptions are defined with the corresponding item{{sub|2}}, item{{sub|4}}, item{{sub|6}}, ...<br> | <div style="background-color:#cfc;width:60%;">For <code>format=2</code> care should be taken when defining the items; it does not matter <br />whether they are pipe-separated or linefeed-separated, but ''file names'' are defined with item{{sub|1}}, item{{sub|3}}, item{{sub|5}}, ... <br />while the 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> | ||
A good idea for an easy way to read input will be (with the possibility not to need the 'format' parameter) | A good idea for an easy way to read input will be (with the possibility not to need the 'format' parameter) | ||
:{{tle|T=G|<br>file1.ext | name1<br>file2.ext | name2<br>...<br>| more parameters}} | :{{tle|T=G|<br />file1.ext | name1<br />file2.ext | name2<br />...<br />| more parameters}} | ||
== Indentions == | == Indentions == | ||
| Line 157: | Line 157: | ||
|- | |- | ||
|style="width:60%"|{{G| | |style="width:60%"|{{G| | ||
Example.png}} ||{{0}} <small>just one file without option parameters</small><br><br><nowiki>{{G| | Example.png}} ||{{0}} <small>just one file without option parameters</small><br /><br /><nowiki>{{G| | ||
Example.png}}</nowiki> <br><br><br><small>That image can as well be obtained with</small><br><nowiki><gallery mode="nolines" showfilename="yes"></nowiki><br><nowiki>Example.png</gallery></nowiki> | Example.png}}</nowiki> <br /><br /><br /><small>That image can as well be obtained with</small><br /><nowiki><gallery mode="nolines" showfilename="yes"></nowiki><br /><nowiki>Example.png</gallery></nowiki> | ||
|- | |- | ||
|{{G|Example ba.svg| | |{{G|Example ba.svg| | ||
Example bn.svg|Example de.svg|Example en.svg|Example ru.svg|Example lt.svg|Example ro.svg|Example tr.svg}} | Example bn.svg|Example de.svg|Example en.svg|Example ru.svg|Example lt.svg|Example ro.svg|Example tr.svg}} | ||
|{{0}} <small>some files, without option parameters</small><br><br><br><br><nowiki>{{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}}</nowiki> | |{{0}} <small>some files, without option parameters</small><br /><br /><br /><br /><nowiki>{{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}}</nowiki> | ||
|- | |- | ||
|{{G|Day-template.svg | |{{G|Day-template.svg | ||
| Line 186: | Line 186: | ||
|Green king.svg|Red king.svg | |Green king.svg|Red king.svg | ||
|Yellow king.svg|Chess kdt45.svg | |Yellow king.svg|Chess kdt45.svg | ||
|f=0|w=80|p=4|a=c}} || {{0}} <small>globally centered with </small> < | |f=0|w=80|p=4|a=c}} || {{0}} <small>globally centered with </small> <code>a=c</code><br /><br /> <pre> | ||
{{G|Blue king.svg|Chess kgt45.svg | {{G|Blue king.svg|Chess kgt45.svg | ||
|Chess krt45.svg|Chess kyt45.svg | |Chess krt45.svg|Chess kyt45.svg | ||
| Line 206: | Line 206: | ||
Light green check.svg|green | Light green check.svg|green | ||
|w=96}} | |w=96}} | ||
|{{0}} <small>Some descriptions are missing</small> <br><br><br><br><pre> | |{{0}} <small>Some descriptions are missing</small> <br /><br /><br /><br /><pre> | ||
{{G| | {{G| | ||
File:Pink check.svg|pink | File:Pink check.svg|pink | ||
| Line 219: | Line 219: | ||
Orange check.svg|{{W|orange}} | Orange check.svg|{{W|orange}} | ||
Light green check.svg|green | Light green check.svg|green | ||
|w=96}}</pre><br><br><br>{{0}} <small>the input is easy to read this way</small><br>{{0}} <small>(and does not need the 'format' parameter)</small><br><br>{{0}} namespace ("file" or "image") won't disturb | |w=96}}</pre><br /><br /><br />{{0}} <small>the input is easy to read this way</small><br />{{0}} <small>(and does not need the 'format' parameter)</small><br /><br />{{0}} namespace ("file" or "image") won't disturb | ||
|- | |- | ||
|{{G|EU-section-with-A.svg|{{W|Austria}}|EU-section-with-BG.svg|{{W|Bulgaria}}|EU-section-with-CY.svg|{{W|Cyprus}} | |{{G|EU-section-with-A.svg|{{W|Austria}}|EU-section-with-BG.svg|{{W|Bulgaria}}|EU-section-with-CY.svg|{{W|Cyprus}} | ||
| Line 225: | Line 225: | ||
|EU-section-with-B.svg|{{W|Belgium}}|EU-section-with-EST.svg|{{W|Estonia}}|EU-section-with-FIN.svg|{{W|Finland}} | |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}} | |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}} | ||
|{{0}} <small>but not so easy to read that way:</small><br><br><pre>{{G|EU-section-with-A.svg|{{W|Austria}}|EU-section-with-BG.svg|{{W|Bulgaria}}|EU-section-with-CY.svg|{{W|Cyprus}} | |{{0}} <small>but not so easy to read that way:</small><br /><br /><pre>{{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-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-B.svg|{{W|Belgium}}|EU-section-with-EST.svg|{{W|Estonia}}|EU-section-with-FIN.svg|{{W|Finland}} | ||
| Line 237: | Line 237: | ||
Structural-Iceberg.svg|{{Plainlinks|1=https://npgallery.nps.gov/AssetDetail/NRIS/1111|2=NRHP}} | Structural-Iceberg.svg|{{Plainlinks|1=https://npgallery.nps.gov/AssetDetail/NRIS/1111|2=NRHP}} | ||
Structural-Iceberg-ja.svg|{{#language:ja}} | Structural-Iceberg-ja.svg|{{#language:ja}} | ||
|w=48|m=n}} ||style="width:78%"|{{0}} <small>the description can also contain an</small> URL<br><pre>{{G| | |w=48|m=n}} ||style="width:78%"|{{0}} <small>the description can also contain an</small> URL<br /><pre>{{G| | ||
Structural-Iceberg-ca.svg|{{Plainlinks|http://lightningvolt.com/Image%20Gallery/imagegallery.htm|URL 1}} | Structural-Iceberg-ca.svg|{{Plainlinks|http://lightningvolt.com/Image%20Gallery/imagegallery.htm|URL 1}} | ||
Structural-Iceberg-cs.svg|{{W|{{#language:cs}}}} | Structural-Iceberg-cs.svg|{{W|{{#language:cs}}}} | ||
| Line 243: | Line 243: | ||
Structural-Iceberg-ja.svg|{{#language:ja}} | Structural-Iceberg-ja.svg|{{#language:ja}} | ||
|w=48|m=n}}</pre> | |w=48|m=n}}</pre> | ||
|} | |} | ||
== See also == | == See also == | ||
Revision as of 23:38, 3 November 2022
<gallery> tag,but with shorter parametrizing and some useful defaults.
Such a gallery can contain one file or more, up to an unlimited number:
- with just {{ G | filename }} a 'gallery' of a single file can be shown,
- with e.g. {{ G | filename1 | filename2 | ... }} more files are displayed.
The display format can be influenced by several additional 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 the six numbers to specify the ⇒ format: 0 to 5whether or how the displayed image(s) should be captioned | 1(or 2) | 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,but that defaulting can be avoided with an empty mode parameter m= | empty nolines | optional | |
ccaption | gallery caption (may be shifted to the left with e.g. some trailing   entities) | empty | optional | |
pperrow | pictures per row | empty | optional | |
sstyle | style attributes, e.g. s=float:right | empty | optional | |
aattr, class | class attributes: any wikimedia class; or the special code "c" ( a=c) for a global <center> tag | empty | optional | |
wwidths | width for the displays | empty | optional | |
hheights | height for the displays | empty | optional | |
ddisplay | display size; can specify widths and heights | empty | optional | |
nnotself | when invoked from a file: don't display the image itself | 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}} and {{Gallery items}}
Some Lua-based iteration templates have an option to invoke the gallery function; mainly the templates
Derivative versions and Other versions, as well as Filelist and File can invoke either one of Iteration or Galeria.
But for the language gallery of a multi-language file, use one of
Localization
This template is not intended to be localized.
The parameter "w", "d", "h"
The display size can be specified with either widths and/or heights, or with display.
While "w" and "h" can specify the number of the pixels, "d" consists of three optional parts: [w] [xh] [px].
"w" and/or "h" have precedence: "d" is only checked when neither "w" nor "h" are specified.
The parameter "format"
can specify one of the following numbers how naming captions for the single files are displayed:
- no naming; same as specifying an empty
f=, or another value - naming with the "showfilename" option
- naming with the second value of parameter pairs (default is the first value, linked)
- same as format=2 but the defaults are displayed without link
- same as format=2 (default is the first value, linked, but without the extension)
- same as format=4 but the name is not linked
When format and width and mode are missing, mode becomes defaulted with nolines.
Defaulting the "format"
This parameter is a necessary addition to the parameters used by <gallery>.
When the most frequent invocation form for <gallery> is used, i.e.
- the first parameter is preceded by a linefeed,
- and the second parameter exists,
- and it is separated from the first one by a pipe,
- and it does not also end with a
.and file extension
- and it does not also end with a
then no format must be specified, "f=2" is assumed, and
the display with {{G| ... }} is the almost same as with <gallery> ... </gallery>.
When not all these requirements are fulfilled, the parameter needs to be specified!
Otherwise a missing format parameter is defaulted with "f=1".
- but only the form as described above will result in the "format" defaulting.
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.
Each unnamed parameter (p1 to p∞) can contain an unlimited number of linefeed-separated items.
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 description 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; but a description as e.g. will be used!
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 the descriptions are defined with the corresponding item2, item4, item6, ...
Description items can be specified empty, but file name items ought to contain a value.
A good idea for an easy way to read input will be (with the possibility not to need the 'format' parameter)
- {{ G |
file1.ext | name1
file2.ext | name2
...
| more parameters }}
Indentions
Indentions are not intended by the gallery tag, if any are required the aligne attribute of tables can be used, e.g.
{|
|style="padding-left:2em"|{{G|..... }}
|}
Examples
Shows different parametrizings, and item notations (separation with "pipes" and linefeeds).
| just one file without option parameters {{G| Example.png}} That image can as well be obtained with <gallery mode="nolines" showfilename="yes"> Example.png</gallery> | |
| some files, without option 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
|c=eight smileys    |f=0|w=48|m=n}}
|
globally centered with a=c{{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|a=c}}
| |
|
Some descriptions are missing {{G|
File:Pink check.svg|pink
Purple check.svg|purple
Olive green check.svg|{{W|olive}}
image: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
|w=96}}the input is easy to read this way (and does not need the 'format' parameter) namespace ("file" or "image") won't disturb |
but not so easy to read that way:{{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}}
|
|
the description can also contain an URL{{G|
Structural-Iceberg-ca.svg|{{Plainlinks|http://lightningvolt.com/Image%20Gallery/imagegallery.htm|URL 1}}
Structural-Iceberg-cs.svg|{{W|{{#language:cs}}}}
Structural-Iceberg.svg|{{Plainlinks|1=https://npgallery.nps.gov/AssetDetail/NRIS/1111|2=NRHP}}
Structural-Iceberg-ja.svg|{{#language:ja}}
|w=48|m=n}}
|
See also
- {{Gallery}} and Module:Gallery