Child pages
  • Gallery Macro
Skip to end of metadata
Go to start of metadata

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. See below for instructions on how to add the gallery macro to your page.

The gallery macro appears as in the screenshot below.

Screenshot: The Gallery Macro in Confluence

On this page:

Usage with the Macro Browser

To insert the gallery macro into a page using the Macro Browser,

  1. Open the Confluence page or blog post that you want to edit, then click the 'Edit' button.
  2. Click the Macro Browser icon on the toolbar. The macro browser window will open.
  3. Scroll through the list of macros to find the one you want. Alternatively, start typing the macro name into the search box at the top right of the macro browser. Macros with a matching name will appear in the main pane.
  4. Click the desired macro.
  5. Set the macro parameters to your requirements. If desired, you can preview these changes by clicking 'Refresh'.
  6. Click 'Insert' to add the macro onto the page.

(tick) You can also insert macros via autocomplete. For more information, see Using Autocomplete in the Rich Text Editor.

Once you've found the gallery macro, click 'insert' to add it to your page.

Usage with the Wiki Markup Editor

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

Parameters

Parameters are options that you can include in Confluence macros to control the content or format of the macro output. The table below lists relevant parameters for this macro.

Parameter names are different in the macro browser and in wiki markup. Below we show the macro browser parameter names in bold text, and the equivalent wiki markup parameters in (bracketed) text. If we do not show any parameter name for the wiki markup, then you should leave out the parameter name and simply include the parameter value as the first parameter, immediately after the colon (:).

Considerations for using the gallery macro

  • The images shown in the gallery are taken from the files attached to the Confluence page. 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 comments below the images are drawn from the comments on the attachments. For information about adding comments to attachments, see Attaching Files to a Page.
  • By default, the gallery will include all the images attached to the page. You can also exclude or include images using parameters as described below.
  • Only the following file formats are supported: gif, png, jpeg. The bmp format is not supported.
  • You can sort your images into a particular order — see details below.
  • You can specify a title for the gallery and also configure how many columns you want for the table in which your images are displayed. See below for details of the parameters to use.
  • Read the rest of this page for more information.

Examples

Basic Usage, Specifying Number of Table Columns

{gallery:title=Some office photos, and a waterfall|columns=3}

Excluding an Image

{gallery:title=Some office photos, without the waterfall|exclude=waterfall.jpg}

Specifying the Images to be Included

The macro code below will show only two images: 'office1.jpg' and 'waterfall.jpg'.

{gallery:title=One office photo, and a waterfall|include=office1.jpg,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.

{gallery:title=Some office photos, and a waterfall|page=Gallery of Pictures}

Below, we specify a page in a different space.

{gallery:title=Some office photos, and a waterfall|page=DOC:Gallery of Pictures}

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.

{gallery:title=One office photo, and a waterfall|page=Gallery of Pictures|include=office1.jpg,waterfall.jpg}

Sorting the Images by File Name

{gallery:title=Some office photos, and a waterfall|sort=name}

Sorting the Images to Show Most-Recently-Modified First

{gallery:title=Some office photos, and a waterfall|sort=date|reverseSort}



RELATED TOPICS

Viewing Images as a Slide Show
Displaying an Image
Displaying a Thumbnail Image
Attaching Files to a Page
Editing Attachment Properties
Working with Macros

Take me back to the Wikis Help Guide.