Template:G/doc: Difference between revisions
Template page
More actions
m Fix Linter errors. |
Prefix language interwiki links with w: |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
<!-- {{Underconstruction|date=2019-5-5|user=Sarang|notready=on|invite=Please wait a bit!{{0}}}} | <!-- {{Underconstruction|date=2019-5-5|user=Sarang|notready=on|invite=Please wait a bit!{{0}}}} | ||
{{redirects|gallery}} --> | {{redirects|gallery}} --> | ||
<div style="margin:0.5em; border:4px solid black; padding: 0.5em 1.5em 0.5em 0.5em; text-align:center;"> | |||
[[File:Kerze 2007k.JPG|30px|left]] The creator of the template User '''Sarang''' passed away on September 20, 2023, four months after working on this documentation. <br /> | |||
[[:w:de:Benutzer:Sarang/Kondolenzliste|Condolences]]</div> | |||
{{TemplateBox | {{TemplateBox | ||
|1 =1 | |1 =1 | ||
|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]] | ||
|1d-td =(list of) file(s) to be displayed, can be in different ⇒ notations | |||
|1d-de =(Liste der) Datei(en), die angezeigt werden sollen, kann in verschiedenen [[#File list notations|⇒ Notationen]] vorliegen | |||
|1d-td-de=(Liste der) Datei(en), die angezeigt werden sollen, kann in verschiedenen ⇒ Notationen vorliegen | |||
|1def = | |1def = | ||
|1stat =suggested | |1stat =suggested | ||
| Line 10: | Line 16: | ||
|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 | ||
|2d-td =one of the six numbers to specify the ⇒ format: 0 to 5, whether or how the displayed image(s) should be captioned | |||
|2d-de =eine der sechs Zahlen, um das [[#Der Parameter „format“|⇒ Format]] festzulegen: <code>0</code> bis <code>5</code><br /> | |||
ob und wie die angezeigten Bilder mit Bildunterschriften versehen werden sollen | |||
|2d-td-de =eine der sechs Zahlen, um das ⇒ Format festzulegen: 0 bis 5, ob und wie die angezeigten Bilder mit Bildunterschriften versehen werden sollen | |||
|2aliases=format | |2aliases=format | ||
|2def =1 | |2def =1 or 2 | ||
|2stat =optional- | |2stat =optional- | ||
|3 =m | |3 =m | ||
|3d =gallery mode, can be specified with <br /> | |3d =gallery mode, can be specified with <br /><syntaxhighlight inline lang=wikitext>t</syntaxhighlight> or <syntaxhighlight inline lang=wikitext>traditional</syntaxhighlight><br /><syntaxhighlight inline lang=wikitext>n</syntaxhighlight> or <syntaxhighlight inline lang=wikitext>nolines</syntaxhighlight>, <br /><syntaxhighlight inline lang=wikitext>p</syntaxhighlight> or <syntaxhighlight inline lang=wikitext>packed</syntaxhighlight>,<br /><syntaxhighlight inline lang=wikitext>h</syntaxhighlight> or <syntaxhighlight inline lang=wikitext>packed-hover</syntaxhighlight>, <br /><syntaxhighlight inline lang=wikitext>o</syntaxhighlight> or <syntaxhighlight inline lang=wikitext>packed-overlay</syntaxhighlight>, <br /><syntaxhighlight inline lang=wikitext>s</syntaxhighlight> or <syntaxhighlight inline lang=wikitext>slideshow</syntaxhighlight> <br />when parameter <syntaxhighlight inline lang=wikitext>format</syntaxhighlight> is not specified, <syntaxhighlight inline lang=wikitext>nolines</syntaxhighlight> is defaulted, but that defaulting can be avoided with an empty mode parameter <syntaxhighlight inline lang=wikitext>m=</syntaxhighlight> | ||
|3d-td =gallery mode, can be specified with t or traditional, "n" 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=" | |||
|3d-de =Galeriemodus, kann angegeben werden mit: <br /><syntaxhighlight inline lang=wikitext>t</syntaxhighlight> oder <syntaxhighlight inline lang=wikitext>traditional</syntaxhighlight><br /><syntaxhighlight inline lang=wikitext>n</syntaxhighlight> oder <syntaxhighlight inline lang=wikitext>nolines</syntaxhighlight>, <br /><syntaxhighlight inline lang=wikitext>p</syntaxhighlight> oder <syntaxhighlight inline lang=wikitext>packed</syntaxhighlight>,<br /><syntaxhighlight inline lang=wikitext>h</syntaxhighlight> oder <syntaxhighlight inline lang=wikitext>packed-hover</syntaxhighlight>, <br /><syntaxhighlight inline lang=wikitext>o</syntaxhighlight> oder <syntaxhighlight inline lang=wikitext>packed-overlay</syntaxhighlight>, <br /><syntaxhighlight inline lang=wikitext>s</syntaxhighlight> oder <syntaxhighlight inline lang=wikitext>slideshow</syntaxhighlight><br />Wenn der Parameter <syntaxhighlight inline lang=wikitext>format</syntaxhighlight> nicht angegeben ist, wird <syntaxhighlight inline lang=wikitext>nolines</syntaxhighlight> als Standard verwendet, was aber mit einem leeren Modusparameter <syntaxhighlight inline lang=wikitext>m=</syntaxhighlight> vermieden werden kann. | |||
|3d-td-de =Galeriemodus, kann mit „t“ oder „traditional“, „n“ oder „nolines“, „p“ oder „packed“, „h“ oder „packed-hover“, „o“ oder „packed-overlay“, „s“ oder „slideshow“ angegeben werden, wenn der Parameter „format“ nicht angegeben ist. wird „nolines“ als Standard verwendet, aber das kann man umgehen, indem man den Modusparameter „m=“ leer lässt. | |||
|3aliases=mode | |3aliases=mode | ||
|3def = | |3def = | ||
|3stat =optional- | |3stat =optional- | ||
|4 =c | |4 =c | ||
|4d =gallery caption <small>(may be shifted to the left with e.g. some trailing <code>&emsp;</code> entities)</small> | |4d =gallery caption <small>(may be shifted to the left with e.g. some trailing <code>&emsp;</code> entities)</small> | ||
|4d-td =gallery caption (may be shifted to the left with e.g. some trailing   entities | |||
|4d-de =Galeriebeschriftung <small>(kann z. B. mit einigen nachgestellten <code>&emsp;</code>-Entitäten nach links verschoben werden)</small> | |||
|4d-td-de=Galeriebeschriftung (kann z. B. mit einigen nachgestellten  -Zeichen nach links verschoben werden) | |||
|4aliases=caption | |4aliases=caption | ||
|4stat =optional- | |4stat =optional- | ||
| Line 27: | Line 43: | ||
|5 =p | |5 =p | ||
|5d =pictures {{T\|per row}} | |5d =pictures {{T\|per row}} | ||
|5d-td =pictures per row | |||
|5d-de =Bilder {{T\|pro Zeile}} | |||
|5d-td-de=Bilder pro Zeile | |||
|5aliases=perrow | |5aliases=perrow | ||
|5stat =optional- | |5stat =optional- | ||
| Line 32: | Line 51: | ||
|6 =s | |6 =s | ||
|6d =style attributes, e.g. <code>s=float:right</code> | |6d =style attributes, e.g. <code>s=float:right</code> | ||
|6d-td =style attributes, e.g. "s=float:right" | |||
|6d-de =Style-Attribute, z. B. <code>s=float:right</code> | |||
|6d-td-de=Style-Attribute, z. B. „s=float:right“ | |||
|6aliases=style | |6aliases=style | ||
|6stat =optional- | |6stat =optional- | ||
| Line 37: | Line 59: | ||
|7 =a | |7 =a | ||
|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 | |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 | ||
|7d-td =class attributes: any wikimedia class; or the special code "c" ("a=c") for a global <center> tag | |||
|7d-de =Class-Attribute: jede Wikimedia-Klasse; <br />oder der spezielle Code „c“ (<code>a=c</code>) für ein globales <code><nowiki><center></nowiki></code>-Tag | |||
|7d-td-de=Class-Attribute: Jede Wikimedia-Klasse oder der spezielle Code „c“ („a=c“) für einen globalen <center>-Tag. | |||
|7aliases=attr, class | |7aliases=attr, class | ||
|7stat =optional- | |7stat =optional- | ||
| Line 42: | Line 67: | ||
|8 =w | |8 =w | ||
|8d =width for the displays | |8d =width for the displays | ||
|8d-td =width for the displays | |||
|8d-de =Breite für die Displays | |||
|8d-td-de=Breite für die Displays | |||
|8aliases=widths | |8aliases=widths | ||
|8stat =optional- | |8stat =optional- | ||
| Line 47: | Line 75: | ||
|9 =h | |9 =h | ||
|9d =height for the displays | |9d =height for the displays | ||
|9d-td =height for the displays | |||
|9d-de =Höhe für die Displays | |||
|9d-td-de=Höhe für die Displays | |||
|9aliases=heights | |9aliases=heights | ||
|9stat =optional- | |9stat =optional- | ||
| Line 52: | Line 83: | ||
|10 =d | |10 =d | ||
|10d =display size; can specify <code>widths</code> ''and'' <code>heights</code> | |10d =display size; can specify <code>widths</code> ''and'' <code>heights</code> | ||
|10d-td =display size; can specify "widths" and "heights" | |||
|10d-de =Anzeigegröße; kann <code>Breiten</code> '''und''' <code>Höhen</code> angeben | |||
|10d-td-de=Anzeigegröße; kann Breiten und Höhen angeben | |||
|10aliases=display | |10aliases=display | ||
|10stat =optional- | |10stat =optional- | ||
| Line 57: | Line 91: | ||
|11 =t | |11 =t | ||
|11d =text size; can specify a tag like e.g. "small" or "big" | |11d =text size; can specify a tag like e.g. "small" or "big" | ||
|11d-de =Textgröße; du kannst ein Tag wie z. B. “small“ oder “big“ angeben. | |||
|11aliases=text | |11aliases=text | ||
|11stat =optional- | |11stat =optional- | ||
| Line 62: | Line 97: | ||
|12 =n | |12 =n | ||
|12d =when invoked from a file: don't display the image itself | |12d =when invoked from a file: don't display the image itself | ||
|12d-td =when invoked from a file: don't display the image itself | |||
|12d-de =wenn von einer Datei-Seite aufgerufen: Zeig das eigentliche Bild nicht an. | |||
|12d-td-de=wenn von einer Datei-Seite aufgerufen: Zeig das eigentliche Bild nicht an. | |||
|12aliases=notself | |12aliases=notself | ||
|12stat =optional- | |12stat =optional- | ||
|name={{BASEPAGENAME}} | |name={{BASEPAGENAME}} | ||
|desc | |desc=Displays a gallery of files, using just the conventional <syntaxhighlight inline lang=wikitext><gallery></syntaxhighlight> tag, but with shorter parametrizing and some useful defaults. | ||
|desc-td=Displays a gallery of files, using just the conventional "gallery" tag, but with shorter parametrizing and some useful defaults. | |||
|desc-de=Zeigt eine Galerie von Dateien an, indem einfach das übliche Tag <syntaxhighlight inline lang=wikitext><gallery></syntaxhighlight> benutzt wird, aber mit kürzeren Parametern und ein paar nützlichen Standardeinstellungen. | |||
|desc-td-de=Zeigt eine Galerie von Dateien an, indem einfach das übliche Tag "gallery" benutzt wird, aber mit kürzeren Parametern und ein paar nützlichen Standardeinstellungen. | |||
|namespace=all | |||
|namespace= | |||
|usergroup=all | |usergroup=all | ||
|usage-notes= | |usage-notes={{LangSwitch | ||
| | |en = Such a gallery can contain one file or more, up to an unlimited number: | ||
* with just {{Tle|T=G|filename}} a 'gallery' of a single file can be shown, | |||
* with e.g. {{Tle|T=G|filename1|filename2| … }} more files are displayed. | |||
The display format can be influenced by several additional options. | |||
==== 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] [<code>x</code>h] [px].<br /> | 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. | ||
== The parameter "format" == | ==== The parameter "format" ==== | ||
can specify one of the following numbers how naming captions for the single files are displayed: | can specify with one of the following numbers how naming captions for the single files are displayed: | ||
#<li value="0"> no naming; same as specifying an empty '''<code>f=</code>''' , or another value | #<li value="0"> no naming; same as specifying an empty '''<code>f=</code>''' , or another value | ||
# 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) --> | ||
| Line 108: | Line 129: | ||
# same as format=2 (default is the first value, linked, but ''without'' the extension) | # same as format=2 (default is the first value, linked, but ''without'' the extension) | ||
# same as format=4 but the name is not linked | # same as format=4 but the name is not linked | ||
{{Notice|1= While options like <code>showfilename</code> or <code>mode=slideshow</code> are deprecated in namespaces as e.g. articles or galleries, they can be very useful in e.g. file descriptions, or talk pages.</div> | |||
When format ''and'' width ''and'' mode are missing, <code>mode</code> becomes defaulted with <code>nolines</code>. | When <code>format</code> ''and'' <code>width</code> ''and'' <code>mode</code> are missing, <code>mode</code> becomes defaulted with <code>nolines</code>.}} | ||
=== Defaulting the "format" === | ===== Defaulting the "format" ===== | ||
The parameter <code>format</code> is a necessary addition to the parameters used by <syntaxhighlight inline lang=wikitext><gallery></syntaxhighlight>.<br /> | |||
When the most frequent invocation form for < | When the most frequent invocation form for <syntaxhighlight inline lang=wikitext><gallery></syntaxhighlight> is used, i.e. | ||
* the first parameter is preceded by a linefeed, | * the first parameter is preceded by a linefeed, | ||
:* ''and'' the second parameter exists, | :* ''and'' the second parameter exists, | ||
| Line 119: | Line 140: | ||
:::* ''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 < | the display with <syntaxhighlight inline lang=wikitext>{{G| … }}</syntaxhighlight> is the almost same as with <syntaxhighlight inline lang=wikitext><gallery> … </gallery></syntaxhighlight>.<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>'''". | ||
{{Notice|1=There are other valid possibilities to specify the parameters; | |||
::::but ''only the form as described above'' will result in the | ::::but ''only the form as described above'' will result in the <code>format</code> defaulting.}} | ||
== File list notations == | ==== File list notations ==== | ||
The list of the files ("items") for the gallery can be specified in the notation | The list of the files ("items") for the gallery can be specified in the notation | ||
;List 1: {{tle|T=G|file1.ext|file2.ext| | ;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 /> | ;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. | ||
{{Notice|1=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. | Each unnamed parameter (p{{sub|1}} to p{{sub|∞}}) can contain an '''unlimited number''' of linefeed-separated items. {{See also |Template talk:G#Item separation|overview}} }} | ||
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| | ;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. <code>&nbsp;</code> will be used! | 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! | ||
{{Notice |1=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. | 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) | 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 /> | :{{tle|T=G|<br />file1.ext | name1<br />file2.ext | name2<br />…<br />| more parameters}} | ||
== Indentions == | == Indentions == | ||
Indentions are not intended by the gallery tag, if any are required the | Indentions are not intended by the <syntaxhighlight inline lang=wikitext><gallery></syntaxhighlight> tag, if any are required the <code>align</code> attribute of tables can be used, e.g. <syntaxhighlight copy line lang=wikitext> | ||
{| | |||
|style="padding-left:2em"|{{G| … }} | |||
|}</syntaxhighlight> | |||
|de = So eine Galerie kann eine Datei oder mehrere enthalten, die Anzahl ist nicht begrenzt: | |||
* mit lediglich {{Tle|T=G|Dateiname}} kann eine „Galerie” mit einer einzigen Datei angezeigt werden, | |||
* mit z. B. {{Tle|T=G|Dateiname1|Dateiname2| ... }} werden mehrere Dateien angezeigt. | |||
Das Anzeigeformat kann durch mehrere zusätzliche Optionen beeinflusst werden. | |||
==== Die Parameter „w“, „d“, „h“ ==== | |||
Die Displaygröße kann entweder mit <code>widths</code> und/oder <code>heights</code> oder mit <code>display</code> angegeben werden. | |||
Während „w” und „h” die Anzahl der Pixel angeben können, besteht „d” aus drei optionalen Teilen: [w] [<code>x</code>h] [px].<br /> | |||
„w” und/oder „h” haben Vorrang: „d” wird nur überprüft, wenn weder „w” noch „h” angegeben sind. | |||
==== Der Parameter „format“ ==== | |||
kann mit einer der folgenden Zahlen festlegen, wie die Benennung der einzelnen Dateien angezeigt wird: | |||
#<li value="0"> keine Benennung; wie die Angabe eines leeren '''<code>f=</code>''' oder eines anderen Werts | |||
# Benennung mit der Option „showfilename“ <!-- (<code>f=1</code> ist auch die Standardeinstellung) --> | |||
# Benennung mit dem zweiten Wert der Parameterpaare (Standard ist der erste Wert, verlinkt) | |||
# wie format=2, aber die Standardeinstellungen werden ohne Link angezeigt | |||
# wie format=2 (Standard ist der erste Wert, verlinkt, aber ''ohne'' die Erweiterung) | |||
# wie format=4, aber der Name ist nicht verlinkt | |||
{{Notice|1=Obwohl Optionen wie <code>showfilename</code> oder <code>mode=slideshow</code> in Namensräumen wie z. B. Artikeln oder Galerien nicht mehr verwendet werden sollten, können sie in Dateibeschreibungen oder Diskussionsseiten echt nützlich sein. | |||
Wenn <code>format</code> ''und'' <code>width</code> ''und'' <code>mode</code> fehlen, wird <code>mode</code> standardmäßig auf <code>nolines</code> gesetzt.}} | |||
===== Standardwert für „Format“ ===== | |||
Der Parameter <code>format</code> ist eine wichtige Ergänzung zu den Parametern, die von <syntaxhighlight inline lang=wikitext><gallery></syntaxhighlight> benutzt werden.<br /> | |||
Wenn die häufigste Aufrufform für <syntaxhighlight inline lang=wikitext><gallery></syntaxhighlight> benutzt wird, also | |||
* dem ersten Parameter ein Zeilenumbruch vorangestellt ist, | |||
:* ''und'' der zweite Parameter vorhanden ist, | |||
::* ''und'' er durch ein Pipe-Zeichen vom ersten getrennt ist, | |||
:::* ''und'' er ''nicht auch'' mit einem <code>.</code> und einer Dateiendung endet | |||
dann ''darf kein Format angegeben werden'', es wird „'''<syntaxhighlight inline lang=wikitext>f=2</syntaxhighlight>'''” angenommen und | |||
die Anzeige mit <syntaxhighlight inline lang=wikitext>{{G| ... }}</syntaxhighlight> ist fast die gleiche wie mit <syntaxhighlight inline lang=wikitext><gallery> ... </gallery></syntaxhighlight>.<br /> | |||
Wenn nicht alle diese Anforderungen erfüllt sind, dann muss der Parameter angegeben werden!<br /> | |||
Sonst wird ein fehlender Formatparameter standardmäßig mit „'''<code>f=1</code>'''” ersetzt. | |||
{{Notice|1=Es gibt noch andere Möglichkeiten, die Parameter festzulegen, aber ''nur die oben beschriebene Form'' führt dazu, dass das <code>format</code> standardmäßig verwendet wird.}} | |||
==== Notationen der Dateiliste ==== | |||
Die Liste der Dateien (“items“) für die Galerie kann in der Notation | |||
;Liste 1: {{tle|T=G|Datei1.ext|Datei2.ext|…|Datei{{sub|n}}.ext|weitere Parameter}} | |||
oder als Liste durch ''obligatorische Zeilenumbrüche'' getrennt angegeben werden | |||
;Liste 2: {{tle|T=G|<br />file1.ext<br />file2.ext<br />…<br />file{{sub|n}}.ext<br />|weitere Parameter}} | |||
Auch eine Mischung aus beiden Notationen ist möglich. | |||
{{Notice|1=Die Dateinamen (“items“) werden mit unbenannten Parametern angegeben.<br /> | |||
Mit <code>1=</code>, <code>2=</code>, <code>3=</code> bis zu <code>n=</code> kann man eine '''unbegrenzte Anzahl''' von „items“ angeben.<br /> | |||
Jeder unbenannte Parameter (p{{sub|1}} bis p{{sub|∞}}) kann eine '''unbegrenzte Anzahl''' von durch Zeilenumbrüche getrennten Elementen enthalten. {{See also|Template talk:G#Item separation|Übersicht}}}} | |||
Für <code>format=2</code> musst du ''Parameterpaare'' aus Datei + Beschreibung angeben: | |||
;Liste 3: {{tle|T=G|datei1.ext|beschreibung1|datei2.ext|beschreibung2|…|datei{{sub|n}}.ext|beschreibung{{sub|n}}|p8= f|2|weitere Parameter}} | |||
Dieses Format braucht immer Parameterpaare, aber die Beschreibung kann ohne Wert sein (nur ein Pipe-Zeichen oder eine leere Zeile). | |||
Wenn die Beschreibung leer ist, wird stattdessen der Name der Datei angezeigt; aber eine Beschreibung wie z. B. <code>&nbsp;</code> wird verwendet! | |||
{{Notice|1=Bei <code>format=2</code> muss man bei der Definition der Elemente vorsichtig sein; es ist egal, ob sie durch Pipe-Zeichen oder Zeilenumbrüche getrennt sind, aber „Dateinamen” werden mit item{{sub|1}}, item{{sub|3}}, item{{sub|5}},… definiert, während die Beschreibungen mit den entsprechenden item{{sub|2}}, item{{sub|4}}, item{{sub|6}},… definiert werden. Beschreibungselemente können leer angegeben werden, aber Dateinamenelemente sollten einen Wert enthalten.}} | |||
Eine einfache Möglichkeit zum Lesen der Eingabe wäre (mit der Option, den Parameter „format” wegzulassen) | |||
:{{tle|T=G|<br />datei1.ext | name1<br />datei2.ext | name2<br />...<br />| weitere Parameter}} | |||
==== Einrückungen ==== | |||
Einrückungen sind mit dem Tag <syntaxhighlight inline lang=wikitext><gallery></syntaxhighlight> nicht vorgesehen. Wenn du welche brauchst, kannst du das Attribut <code>align</code> von Tabellen verwenden, z. B. <syntaxhighlight copy line lang=wikitext> | |||
{| | {| | ||
|style="padding-left:2em"|{{G|... | |style="padding-left:2em"|{{G| … }} | ||
|} | |}</syntaxhighlight> | ||
}} | |||
|type=formatting | |||
|example= | |||
|i18n-method=- | |||
|i18n-desc= | |||
|seealso= | |||
* {{T|F}} has a reduced [[Template:F#Gallery_style|Gallery Function]] | |||
* {{T|Gallery}} | |||
* [[Module:Gallery]] | |||
* {{T|Gallery items}} | |||
* {{W|Help:Images#Rendering a gallery of_images||mw}} (on mediawiki.org) | |||
* some {{C|Lua-based iteration templates}} have an option to invoke the gallery function; they invoke either {{M|Iteration}} or {{M|Galeria}}. For easy switching between both modules, their shortcode character parameters [[Module talk:Galeria/doc|won't conflict]]. | |||
** {{T|Derivative versions}} | |||
** {{T|Other versions}} | |||
** {{T|Filelist}} | |||
** {{T|File}} | |||
* for the language gallery of a '''multi-language file''', use one of | |||
** {{T|Lang gallery}} | |||
** {{T|Lgallery}} | |||
** {{T|Svg lang}} | |||
|setscats= | |||
|lines= | |||
|shorthand= | |||
|relieson={{Lua|Module:Galeria}} | |||
|useTemplateData=yes | |||
}} | |||
== Examples == | == Examples == | ||
See here for different parameterisations and item notations, separated with pipes (|) and linefeeds (¶). | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- style="vertical-align:top;" | ||
|{{G| | |||
Example.png}} || | Example.png}} || Just one file without option parameters <syntaxhighlight copy line lang=wikitext>{{G| | ||
Example.png}}</ | Example.png | ||
|- | }}</syntaxhighlight> That image can as well be obtained with <syntaxhighlight copy line lang=wikitext><gallery mode="nolines" showfilename="yes">Example.png</gallery></syntaxhighlight> | ||
|- style="vertical-align:top;" | |||
|{{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}} | ||
| | |Some files, without option parameters <syntaxhighlight copy line lang=wikitext>{{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}}</syntaxhighlight> | ||
|- | |- style="vertical-align:top;" | ||
|{{G|Day-template.svg | |{{G|Day-template.svg | ||
Emojione 1F642.svg | Emojione 1F642.svg | ||
| Line 172: | Line 282: | ||
Line-style-icons-happy.svg | Line-style-icons-happy.svg | ||
Nuvola emoticon - happy.svg | Nuvola emoticon - happy.svg | ||
|f=0|w=48|m=n|c=eight smileys                        }} || < | |f=0|w=48|m=n|c=eight smileys                        }} || <syntaxhighlight copy line lang=wikitext>{{G|Day-template.svg | ||
Emojione 1F642.svg | Emojione 1F642.svg | ||
Emojione BW 1F642.svg | Emojione BW 1F642.svg | ||
| Line 180: | Line 290: | ||
Line-style-icons-happy.svg | Line-style-icons-happy.svg | ||
Nuvola emoticon - happy.svg | Nuvola emoticon - happy.svg | ||
|c=eight smileys & | |f=0|w=48|m=n|c=eight smileys                        }}</syntaxhighlight> | ||
|- | |- style="vertical-align:top;" | ||
| style="background:#CCC" | {{G|Blue king.svg|Chess kgt45.svg | | style="background:#CCC" | {{G|Blue king.svg|Chess kgt45.svg | ||
|Chess krt45.svg|Chess kyt45.svg | |Chess krt45.svg|Chess kyt45.svg | ||
|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}} || | |f=0|w=80|p=4|a=c}} || globally centered with <code>a=c</code> <syntaxhighlight copy line lang=wikitext>{{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 | ||
|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}}</ | |f=0|w=80|p=4|a=c}}</syntaxhighlight> | ||
|- | |- style="vertical-align:top;" | ||
|{{G| | |{{G| | ||
File:Pink check.svg|pink | File:Pink check.svg|pink | ||
| Line 206: | Line 315: | ||
Light green check.svg|green | Light green check.svg|green | ||
|w=96}} | |w=96}} | ||
| | | Some descriptions are missing. The input is easy to read this way and does not need the 'format' parameter. Namespace ("file" or "image") won't disturb. <syntaxhighlight copy line lang=wikitext> | ||
{{G| | {{G| | ||
File:Pink check.svg|pink | File:Pink check.svg|pink | ||
| Line 219: | Line 328: | ||
Orange check.svg|{{W|orange}} | Orange check.svg|{{W|orange}} | ||
Light green check.svg|green | Light green check.svg|green | ||
|w=96}}</ | |w=96}}</syntaxhighlight> | ||
|- | |- style="vertical-align:top;" | ||
|{{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}} | ||
|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}} | ||
|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}} | ||
| | | Not so easy to read that way: <syntaxhighlight copy line lang=wikitext>{{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}} | ||
|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}}</syntaxhighlight> | ||
|- style="vertical-align:top;" | |||
|{{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}}}} | ||
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}} | |w=48|m=n}} || The description can also contain an URL. <syntaxhighlight copy line lang=wikitext>{{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}}}} | ||
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}}</ | |w=48|m=n}}</syntaxhighlight> | ||
|} | |} | ||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| | ||