Template:G/doc: Difference between revisions
More actions
m format |
Prefix language interwiki links with w: |
||
| (53 intermediate revisions by 8 users 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}} --> | |||
<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 | |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 = | |1stat =suggested | ||
|2 =f | |2 =f | ||
|2d =one of | |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 | |||
|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 | |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- | ||
|5 =p | |5 =p | ||
|5d =pictures | |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- | ||
|6 =s | |6 =s | ||
|6d = | |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- | ||
|7 =a | |7 =a | ||
|7d = | |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 | |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 | |||
|7stat =optional- | |7stat =optional- | ||
|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 46: | 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- | ||
|10 = | |10 =d | ||
|10d = | |10d =display size; can specify <code>widths</code> ''and'' <code>heights</code> | ||
|10aliases= | |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 | |||
|10stat =optional- | |10stat =optional- | ||
<!-- Disabled as invalid HTML | |||
|11 =t | |||
|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 | |||
|11stat =optional- | |||
--> | |||
|12 =n | |||
|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 | |||
|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. | ||
|namespace= | |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 | |||
|usergroup=all | |usergroup=all | ||
|usage-notes= | |usage-notes={{LangSwitch | ||
|type= | |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 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 /> | |||
"w" and/or "h" have ''precedence'': "d" is only checked when neither "w" nor "h" are specified. | |||
==== The parameter "format" ==== | |||
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 | |||
# naming with the "showfilename" option <!-- (<code>f=1</code> is also the default) --> | |||
# 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 | |||
{{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 <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" ===== | |||
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 <syntaxhighlight inline lang=wikitext><gallery></syntaxhighlight> 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 <code>.</code> and file extension | |||
then ''no format must be specified'', "'''<code>f=2</code>'''" is assumed, and<br /> | |||
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 /> | |||
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 <code>format</code> defaulting.}} | |||
==== File list notations ==== | |||
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}} | |||
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}} | |||
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 /> | |||
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: | |||
;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 /> | |||
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.}} | |||
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}} | |||
== Indentions == | |||
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| … }} | |||
|}</syntaxhighlight> | |||
}} | |||
|type=formatting | |||
|example= | |example= | ||
|i18n-method=- | |i18n-method=- | ||
|i18n-desc= | |i18n-desc= | ||
|seealso= | |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= | |setscats= | ||
|lines= | |lines= | ||
|shorthand= | |shorthand= | ||
|relieson= | |relieson={{Lua|Module:Galeria}} | ||
|useTemplateData=yes | |||
}} | }} | ||
== Examples == | == Examples == | ||
See here for different parameterisations and item notations, separated with pipes (|) and linefeeds (¶). | |||
{| class="wikitable" | |||
|- style="vertical-align:top;" | |||
|- | |||
|{{G| | |{{G| | ||
Day-template.svg | Example.png}} || Just one file without option parameters <syntaxhighlight copy line lang=wikitext>{{G| | ||
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| | |||
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 | |||
Emojione 1F642.svg | Emojione 1F642.svg | ||
Emojione BW 1F642.svg | Emojione BW 1F642.svg | ||
| Line 106: | 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| | |f=0|w=48|m=n|c=eight smileys                        }} || <syntaxhighlight copy line lang=wikitext>{{G|Day-template.svg | ||
Day-template.svg | |||
Emojione 1F642.svg | Emojione 1F642.svg | ||
Emojione BW 1F642.svg | Emojione BW 1F642.svg | ||
| Line 115: | Line 290: | ||
Line-style-icons-happy.svg | Line-style-icons-happy.svg | ||
Nuvola emoticon - happy.svg | Nuvola emoticon - happy.svg | ||
|f=0|w=48|m=n| | |f=0|w=48|m=n|c=eight smileys                        }}</syntaxhighlight> | ||
|- | |- style="vertical-align:top;" | ||
| {{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| | |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| | |f=0|w=80|p=4|a=c}}</syntaxhighlight> | ||
|- | |- style="vertical-align:top;" | ||
|{{G|File:Pink check.svg|pink | |{{G| | ||
File:Pink check.svg|pink | |||
Purple check.svg|purple | 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 | White check.svg|white | ||
Green check.svg|green | |||
File: | File:Red_check.svg| | ||
Orange check.svg|{{W|orange}} | Orange check.svg|{{W|orange}} | ||
Light green check.svg|green | Light green check.svg|green | ||
|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| | |||
File:Pink check.svg|pink | |||
Purple check.svg|purple | 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 | White check.svg|white | ||
Green check.svg|green | |||
File: | File:Red_check.svg| | ||
Orange check.svg|{{W|orange}} | Orange check.svg|{{W|orange}} | ||
Light green check.svg|green | Light green check.svg|green | ||
|f=2|w= | |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}} | ||
|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}} | |||
| 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-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}}</syntaxhighlight> | |||
|- style="vertical-align:top;" | |||
|{{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}} || 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-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}}</syntaxhighlight> | |||
|} | |} | ||
<includeonly> | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| | ||
[[Category:Marker templates|{{PAGENAME}}]] | [[Category:Marker templates|{{PAGENAME}}]] | ||
[[Category:File namespace templates|{{PAGENAME}}]] | [[Category:File namespace templates|{{PAGENAME}}]] | ||
[[Category:Another file templates| ]] | <!-- [[Category:Another file templates| ]] --> | ||
</includeonly> | [[Category:One-letter templates| ]] | ||
[[Category:Gallery templates]] | |||
}}</includeonly> | |||
Latest revision as of 09:15, 12 August 2026
Condolences
Displays a gallery of files, using just the conventional <gallery> tag, but with shorter parametrizing and some useful defaults.
Usage
{{G |1= }}
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.
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 with 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
Defaulting the "format"
The parameter format 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".
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.
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!
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
<gallery> tag, if any are required the align attribute of tables can be used, e.g. {|
|style="padding-left:2em"|{{G| … }}
|}
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 | 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 | |
|
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information Displays a gallery of files, using just the conventional "gallery" tag, but with shorter parametrizing and some useful defaults.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Relies on:
See also
- {{F}} has a reduced Gallery Function
- {{Gallery}}
- Module:Gallery
- {{Gallery items}}
- Help:Images#Rendering a gallery of_images (on mediawiki.org)
- some Lua-based iteration templates have an option to invoke the gallery function; they invoke either Iteration or Galeria. For easy switching between both modules, their shortcode character parameters won't conflict.
- for the language gallery of a multi-language file, use one of
Localization
This template is not intended to be localized.
Examples
See here for different parameterisations and item notations, separated with pipes (|) and linefeeds (¶).
Just one file without option parameters {{G|
Example.png
}}
<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
|f=0|w=48|m=n|c=eight smileys                        }}
|
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. The input is easy to read this way and does not need the 'format' parameter. Namespace ("file" or "image") won't disturb. {{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}}
|
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}}
|