GalleryPreview is a module that generates a brief gallery preview onto an article page from a designated gallery page.


It is suggested that GalleryPreview is invoked through a template.

The generated gallery may be configured similarly to galleries. These setting customizations must be passed through the settings parameter in the following format:

option1: "value",
option2: "value2"



Link to a page's associated gallery page. Should not be enclosed by brackets.
The number of images to select randomly and include in the generated gallery. If this number exceeds the number of images on the gallery page, the generated gallery will include all images from the gallery page.


The text to be shown if gallery_page links to a non-existent page. If not provided, the module has its own built-in default.
"Portal" image to include in the generated gallery that will link to gallery_page. This will be the last image in the generated gallery, and is counted towards the number_of_images limit.
If any value is passed through this parameter, images on the generated gallery will retain their associated caption from the source gallery. By default, captions are not included.
Gallery customization pairs formatted as option: "value". See #Usage above. By default, the gallery is formatted to be centered, navigation set to true, and to exclude the "add to gallery" button.


This example generates a gallery from images in Global Lua Modules/GalleryPreview/Gallery testing.
| gallery_page = {{FULLPAGENAME}}/Gallery testing
| number_of_images = 3
| default = Whelp, looks like the testing page was deleted.
| include_caption = y
| settings =
    bordersize: "medium"


| gallery_page = Some non-existent page
| number_of_images = 5


No gallery for Global Lua Modules/GalleryPreview exists yet! You can create it here.

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

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+