Difference between revisions of "Template:Gallery"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
== Syntax == | |||
The basic syntax is: | |||
= | <pre> | ||
<gallery> | |||
File:wiki.png | |||
File:wiki.png|Captioned | |||
File:wiki.png|Captioned with alt text|alt=The Wikipedia logo | |||
File:wiki.png|[[Help:Contents/Links|Links]] can be put in captions. | |||
File:wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used… | |||
</gallery> | |||
</pre> | |||
Which produces: | |||
<gallery> | |||
< | File:wiki.png | ||
| | File:wiki.png|Captioned | ||
| | File:wiki.png|Captioned with alt text|alt=The Wikipedia logo | ||
File:wiki.png|[[Help:Contents/Links|Links]] can be put in captions. | |||
File:wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used… | |||
</gallery> | |||
The extended syntax is (see ''[[m:Help:Images and other uploaded files#Gallery|gallery tag help]]'' and below for full list of parameters): | |||
| | |||
== | <pre><gallery caption="Sample gallery" widths="180px" heights="120px" perrow="3"> | ||
File:wiki.png | |||
File:wiki.png|Captioned | |||
File:wiki.png|Captioned with alt text|alt=The Wikipedia logo | |||
File:wiki.png|[[Help:Contents/Links|Links]] can be put in captions. | |||
File:wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used… | |||
</gallery></pre> | |||
</ | Which produces: | ||
<gallery caption="Sample gallery" widths="180px" heights="120px" perrow="3"> | |||
File:wiki.png | |||
File:wiki.png|Captioned | |||
File:wiki.png|Captioned with alt text|alt=The Wikipedia logo | |||
File:wiki.png|[[Help:Contents/Links|Links]] can be put in captions. | |||
File:wiki.png|Full MediaWiki<br />syntax may now be used… | |||
</gallery> | |||
* Images are separated by new lines. | |||
* Captions are optional. | |||
* Notice that there are no brackets except for links within captions. | |||
* A common mistake is to forget the closing <nowiki></gallery></nowiki> tag. | |||
* The default width and height is 120px. | |||
* If <code>perrow=</code> is omitted, the width is fluid: one row comprises as many images as will fit across the available width. Prior to MediaWiki 1.17, the default was 4. |
Revision as of 19:27, 23 August 2012
Syntax
The basic syntax is:
<gallery> File:wiki.png File:wiki.png|Captioned File:wiki.png|Captioned with alt text|alt=The Wikipedia logo File:wiki.png|[[Help:Contents/Links|Links]] can be put in captions. File:wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used… </gallery>
Which produces:
Links can be put in captions.
The extended syntax is (see gallery tag help and below for full list of parameters):
<gallery caption="Sample gallery" widths="180px" heights="120px" perrow="3"> File:wiki.png File:wiki.png|Captioned File:wiki.png|Captioned with alt text|alt=The Wikipedia logo File:wiki.png|[[Help:Contents/Links|Links]] can be put in captions. File:wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used… </gallery>
Which produces:
Links can be put in captions.
- Images are separated by new lines.
- Captions are optional.
- Notice that there are no brackets except for links within captions.
- A common mistake is to forget the closing </gallery> tag.
- The default width and height is 120px.
- If
perrow=
is omitted, the width is fluid: one row comprises as many images as will fit across the available width. Prior to MediaWiki 1.17, the default was 4.