Galleries are collections of uploaded files and videos. There are two main gallery formats:

Basic syntax

The basic wikitext syntax to create a gallery is below. By default, captions appear below the images, but this behavior can change depending on the gallery type or mode. The link parameter functions the same as linking from an image thumbnail.

<gallery widths=150> Example.jpg Example2.png|caption text Example3.png|link=Help:Contents Example4.png|caption [[Help:Links|with a link]]|link=Help:Contents Example5.png|alt=A flower ... </gallery>

Fandom galleries

Fandom wikis make use of the Fandom gallery format, which is vastly different from the default MediaWiki gallery format.

Fandom galleries support three display types; two of them are controlled by the type parameter in the <gallery> tag: default galleries, slideshows, and sliders, all explained below on their respective sections.

Default galleries

<gallery> is the default static grid of images. Captions are displayed below each image.

Here's an example of a generic gallery with images and captions:

<gallery> Example1.png|Caption 1 Example2.png|Caption 2 Example3.png|Caption 3 </gallery> 

Below is a list of all parameters supported by default galleries:

Description Format and options Default
Max image widths, in pixels widths=[number] 185
Images per row columns=[number] Fit to page
Gallery positioning position=[left/center/right] left
Spacing between images spacing=[small/medium/large] medium
Image orientation and cropping orientation=[none/landscape/portrait/square] none
Caption position captionposition=[within/below] below
Caption alignment captionalign=[left/center/right] left
Caption color captiontextcolor=[color code] Article text color
Caption size captionsize=[small/medium/large] medium
Border thickness bordersize=[none/small/medium/large] small
Border color bordercolor=[color code] Theme border color
Gallery caption caption=[text] No caption
"Navigation" modifier navigation=[true/false] false

Slideshows

<gallery type="slideshow"> creates a slideshow of the images that the user can manually browse through. Captions are only displayed on hover as an overlay.

Below we have an example of a generic slideshow with images and captions:.

<gallery type="slideshow"> Example.jpg|Caption 1 Example2.png|Caption 2 Example3.png|Caption 3 </gallery> 

Note that slideshows float on one side, to the right of the page by default, or to the left when set so with the parameter position.
If this is not desired, you have to "clear" the float after the slideshow with something like <div style="clear:both;"></div>
On most wikis, there is a template for this, which is either named {{clear}} or {{clr}}, and often there is a shortcut {{-}} for this.

Below is a list of all parameters supported by slideshows:

Description Format and options Default
Max image widths, in pixels widths=[number] 300
Cropping crop=[true] Disabled, unless parameter is set
Show recent uploads showrecentuploads=[true/false] false
Slideshow position position=[left/center/right] right
Slideshow caption caption=[text] No caption

Sliders

<gallery type="slider"> creates a stylized automatic slideshow with a maximum of four images. Captions are displayed as titles—use |linktext= at the end of each image to display more text. Images are resized to a set width of 670px.

Here's an example of a generic slider with images, captions and links to articles. Note that sliders are always centered horizontally.

<gallery type="slider"> Example.jpg|Caption 1|link=<linked-page-here>|linktext=Description 1 Example1.png|Caption 2|link=<linked-page-here>|linktext=Description 2 Example4.png|Caption 3|link=<linked-page-here>|linktext=Description 3 </gallery> 


Sliders support only one parameter:

Description Format and options Default
Thumbnail orientation orientation=[bottom/right] bottom

MediaWiki galleries

Gamepedia wikis make use of the MediaWiki gallery format.

Modes

MediaWiki galleries support a variety of display modes, controlled by the mode parameter in the <gallery> tag:

  • traditional is the default static grid of images. Captions are displayed below each image.
  • nolines is the same as traditional but without any borders or padding around the images.
  • packed is the same as nolines but all images have the same height and small spacing between them.
  • packed-overlay is the same as packed but the captions are overlayed on top of the images.
  • packed-hover is the same as packed-overlay but each image's caption overlay only appears when the user hovers over the image.
  • slideshow creates a slideshow of the images that the user can manually browse through. Captions are displayed below each image.

Parameters

MediaWiki galleries allow the following optional parameters in the <gallery> tag:

  • mode=traditional creates a traditional gallery. See above for the different gallery modes available.
  • caption="text" displays a caption above the gallery. Only plain text is allowed. Double quotations must be used if any spaces are in the caption text.
  • widths=[number]px sets every image to a specific maximum width. Note that the parameter is plural (widths, not width).
  • heights=[number]px sets every image to a specific maximum height. Note that the parameter is plural (heights, not height).
  • perrow=[number] forces the gallery to show an exact number of images per row. The default is 0, which automatically adjusts the images based on the screen width.
  • showfilename=true will show the filenames for each individual image in their captions.
  • showthumbnails=true is only supported with mode=slideshow and displays a line of thumbnails below the slideshow.

See also

Further help and feedback

Community content is available under CC-BY-SA unless otherwise noted.