The Gallery macro displays a gallery of thumbnail images in a table, based on the images attached to a Confluence page. When viewing the page, a user can click a thumbnail image to zoom into the full-size image and then view the images as a slide show.
For more information about how your readers will view the gallery, please refer to Viewing Images as a Slide Show. Below we tell you how to add the Gallery macro to your page.
Summary of how to use the Gallery macro
|
On this page:
- Using the Gallery Macro
- Some office photos, and a waterfall
- Optional Parameters
- Examples of Optional Parameters
Using the Gallery Macro
Include the following markup in your page, replacing the title with your own:
What you need to type |
|---|
{gallery:title=Some office photos, and a waterfall} |
What you will get |
Optional Parameters
Basic usage, showing two parameters:
Below is the full list of the parameters available.
Parameter |
Optional or Mandatory |
Default |
Description |
|---|---|---|---|
title |
Optional |
Nothing |
Specify a title for your gallery. |
columns |
Optional |
4 |
Specify the number of columns for your table. |
exclude |
Optional |
No exclusions i.e. include all the pictures on the page. |
The gallery will ignore any pictures specified by |
include |
Optional |
Include all the pictures on the page. |
If you specifically include one or more pictures, the gallery will show only those pictures. Format is |
page |
Optional |
If no page is specified, the gallery displays the images attached to the page containing the macro. |
Specify the title of the page which contains the images you want displayed. If the page is in the same space as the page containing the macro, use the format |
slideshow |
N/A |
N/A |
The 'slideshow' parameter is not used in the latest version of the Gallery macro, and the slide show is always enabled. We have left the parameter here for compatibility with older versions of the macro. |
sort |
Optional |
None i.e. the sort order is unspecified and therefore unpredictable. |
Specify an attribute to sort the images by that attribute. Sort order is ascending, unless you specify the 'reverseSort' parameter (see below). Options are:
|
reverseSort |
Optional |
Nothing, i.e. sort order is ascending |
Used in conjunction with 'sort' parameter above. Use 'reverseSort' to reverse the sort order, from ascending to descending. |
If the actual name of an attachment file or page contains a comma, you can refer to it in the exclude, include, or page parameters above by enclosing it in single or double quotes, for example |
Examples of Optional Parameters
Specifying the Number of Columns for your Table
Excluding an Image
Specifying the Images to be Included
The macro code below will show only two images: 'office1.jpg' and 'waterfall.jpg'.
Specifying a Page Name
By default, the images shown in the gallery are taken from the files attached to the Confluence page which contains the macro. You can also specify a different page where the attachments are located. For information about attaching images to a page, see Attaching Files to a Page.
The macro code below expects that the images are attached to a page called 'Gallery of Pictures', in the same space as the page containing the macro.
Below, we specify a page in a different space.
Combining the page and the include parameters, the code below will show only the two images specified, where the images are held as attachments on a different page.
Sorting the Images by File Name
Sorting the Images to Show Most-Recently-Modified First
RELATED TOPICS
Viewing Images as a Slide Show
Displaying an Image
Thumbnail Macro
Attaching Files to a Page
Editing Attachment Details
Working with Macros
Take me back to Confluence User Guide






