Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:G/doc: Difference between revisions

Template page
m -cat
m +cat
Line 176: Line 176:
[[Category:File namespace templates|{{PAGENAME}}]]
[[Category:File namespace templates|{{PAGENAME}}]]
<!-- [[Category:Another file templates| ]] -->
<!-- [[Category:Another file templates| ]] -->
[[Category:One-letter templates| ]]
</includeonly>
</includeonly>

Revision as of 13:39, 18 October 2019

Displays a gallery of files, using just the gallery tag, with shorter parametrizing and some useful defaults.


Such a gallery can contain one ore more (up to an unlimited number) files.
The display format is supported by several options.

Usage

{{G |1= }}

Template parameters

ParameterDescriptionDefaultStatus
1(list of) file(s) to be displayed, can be in different notationsemptysuggested
f
format
one of three values to specify the format, 0 or 1 or 21optional
m
mode
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



empty



nolines
optional
c
caption
gallery captionemptyoptional
p
perrow
pictures per rowemptyoptional
s
style
possible style attribute, e.g. style=float:rightemptyoptional
a
attr
attribute, for definition of class=emptyoptional
w
widths
width for the displaysemptyoptional
h
heights
height for the displaysemptyoptional
t
text
e.g. "small" for lower text sizeemptyoptional

Additional information

The template is intended to be used in the following namespaces: the File namespace

The template is intended to be used by the following user groups: all users

See also

The (reduced) Gallery Function of Template:{{F}}
Another solution: Template:{{Gallery}}

Localization

This template is not intended to be localized.

The parameter "format"

can specify one of three options how naming captions for the single files are displayed:

  1. no naming
  2. naming with the "showfilename" option
  3. naming with the second value of parameter pairs
Note: While options like "showfilename" or "mode=slideshow" are deprecated in namespaces as e.g. articles or galleries, they can be very useful in e.g. file descriptions, or talk pages.

File list notations

The list of the files ("items") for the gallery can be specified in the notation

List 1
{{ Gfile1.extfile2.ext...filen.extmore 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.

The file names ("items") are specified with unnamed parameters.

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.

(See also the overview).


For format=2 parameter pairs of file + description must be specified:

List 3
{{ Gfile1.extdescription1file2.extdescription2...filen.extdescriptionn f = 2more 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. &nbsp; will be used!

For format=2 care should be taken when defining the items;

it does not matter whether they are pipe-separated or linefeed-separated, but file names are defined with item1, item3, item5, ... while descriptions are defined with the corresponding item2, item4, item6, ...

Description items can be specified empty, but file name items ought to contain a value.

A good idea for an easy to read input will be

{{ G
file1.ext
name1
file2.ext
name2
...
more parameters }}

Examples

Shows different parametrizings, and item notations (separation with "pipes" and linefeeds).

0 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>
0 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}}
{{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}}
0 Some descriptions are missing



Purple check.svg|purple
Olive green check.svg|{{W|olive}}
File:Yellow check.svg|yellow
Cornflower blue check.svg|blue
Black check.svg||White check.svg|white|Green check.svg|green
File:Red check.svg|
Orange check.svg|{{W|orange}}
Light green check.svg|green
|f=2|w=96}}




0 the input is easy to read this way
0 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|t=s}}


Cookies help us deliver our services. By using our services, you agree to our use of cookies.