Difference between revisions of "Template:Gallery"

From SolidsWiki
Jump to navigation Jump to search
Line 8: Line 8:
File:wiki.png|Captioned with alt text|alt=The Wikipedia logo
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|[[Help:Contents/Links|Links]] can be put in captions.
File:wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used&hellip;
File:wiki.png|Full [[MediaWiki]]<br />syntax may now be used&hellip;
</gallery>
</gallery>
</pre>
</pre>
Line 19: Line 19:
File:wiki.png|Captioned with alt text|alt=The Wikipedia logo
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|[[Help:Contents/Links|Links]] can be put in captions.
File:wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used&hellip;   
File:wiki.png|Full [[MediaWiki]]<br />syntax may now be used&hellip;   
</gallery>
</gallery>


Line 29: Line 29:
File:wiki.png|Captioned with alt text|alt=The Wikipedia logo
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|[[Help:Contents/Links|Links]] can be put in captions.
File:wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used&hellip;
File:wiki.png|Full [[MediaWiki]]<br />syntax may now be used&hellip;
</gallery></pre>
</gallery></pre>



Revision as of 00:03, 18 February 2013

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:

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:

  • 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.