This documentation relates to the latest version of Confluence.
If you are using an earlier version, please go to the documentation home page and select the relevant version.

Gallery Macro

All Versions

Confluence 3.0 Documentation

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 your desired Confluence page, then click the 'Edit' button. The 'Edit Page' mode opens.
  2. Next, click the Macro Browser icon on the editor toolbar. The Macro Browser will open in the middle of the screen.
  3. In the Macro Browser, type the name of your desired macro into the search box at the top right of the window. Macros with a matching name will appear in the centre pane. Click on the desired macro to see its options screen. Here, you can set the macro parameters then click 'insert' to put the macro into the page.

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 settings for Confluence macros that allow the user to control their content or presentation. The table below lists relevant parameters for this macro.

Parameter names are displayed differently in the macro browser interface and in wiki markup. Below, parameter names used in the macro browser are indicated in Bold text, while their equivalents in wiki markup are indicated in (bracketed) text. If the latter is not shown, then in wiki markup, the parameter's name should be omitted and only its value should be added immediately after the colon symbol (:).

The full list of parameters is shown in the following table.

Parameter Default Description
Gallery Title
(title)
Nothing Specify a title for your gallery.
Number of Columns
(columns)
4 Specify the number of columns for your table.
Images to Exclude
(exclude)
No exclusions i.e. include all the pictures on the page. The gallery will ignore any pictures specified by exclude=picture file name i.e. they will not be included in the gallery. You can specify more than one picture, separated by commas. Example: exclude=my picture.png,my picture2.gif
Include these Images Only
(include)
Include all the pictures on the page. If you specifically include one or more pictures, the gallery will show only those pictures. Format is include=picture file name. You can specify more than one picture, separated by commas. Example: include=my picture.png,my picture2.gif
Use Images in these Pages
(page)
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 page=My Page Name. To specify a page in a different space, use page=SPACEKEY:My Page Name, such as page=DOC:Gallery Macro
Reverse Sort
(reverseSort)
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.
Sort Images By
(sort)
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:
  • 'name' – file name.
  • 'comment' – comment linked to the attached file.
  • 'date' – date/time last modified.
  • 'size' – size of the attached file.
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 "this,that.jpg", theother.png.

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
Thumbnail Macro
Attaching Files to a Page
Editing Attachment Details
Working with Macros

Take me back to the Confluence User Guide.

Labels

thumbnail thumbnail Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Oct 07, 2008

    Ben Shoemate says:

    Some users are complaining that the images are too small (after clicking on the ...

    Some users are complaining that the images are too small (after clicking on the thumbnail). We posted some wireframes with text on them and since the gallery seems to be resolution and browser size specific, they can no longer read it. Is there a setting to either change it back to a pop-up or force it to render at 100% of the image size?

    1. Oct 16, 2008

      Ming Giet Chong says:

      Hi Ben, Confluence actually allows you to limit the maximum size of a single fi...

      Hi Ben,

      Confluence actually allows you to limit the maximum size of a single file attachment. The detailed doc is available at:

      If you have further questions, please feel free to raise a support ticket at https://support.atlassian.com

      Regards,
      MG

      1. Nov 11, 2008

        Mark Meytin says:

        I think Ben was referring to image dimensions, not physical file size.  I h...

        I think Ben was referring to image dimensions, not physical file size.  I have the same problem - we added some images to the gallery, and when viewed with a slideshow, the text on them is unreadable.  It would be nice to have configurable image size when viewed either within a gallery or in the slideshow mode.  In addition, would it be possible to (optionally) include a link to the original while viewing the gallery?  This way if an image is too small to see, a user can click on it and view the original file in the new browser window.

        1. Nov 14, 2008

          Azwandi Mohd Aris says:

          Hi guys, Apologies for any confusion caused here. I guess this problem can be r...

          Hi guys,

          Apologies for any confusion caused here. I guess this problem can be resolved if this feature request can be turned into reality: CONF-6222

          Don't forget to cast your vote!

          Cheers,
          Azwandi

  2. Nov 03, 2008

    Anonymous says:

    Guys, I'm having a really weird problem with the plugin running on Confluence 2....

    Guys, I'm having a really weird problem with the plugin running on Confluence 2.7.3. When I click on the thumbnail, the big picture is appearing at the very bottom of the page, in a way that I have to scroll a long way of blank space before getting it. It's actually way AFTER the footer. Any clue?

    1. Nov 04, 2008

      Azwandi Mohd Aris says:

      Hi, I would suggest you to lodge a support a request at http://support.atlassia...

      Hi,

      I would suggest you to lodge a support a request at http://support.atlassian.com. Remember to attach some screenshots.

      Cheers,
      Azwandi

  3. Nov 18, 2008

    Tomi Strugar says:

    Is there an option for displaying the file name under the picture instead of the...

    Is there an option for displaying the file name under the picture instead of the just the Comment?

    1. Dec 02, 2008

      Azwandi Mohd Aris says:

      Hi Tomi, I am afraid that this feature is not available. If you are keen on it, ...

      Hi Tomi, I am afraid that this feature is not available. If you are keen on it, feel free to raise it in http://jira.atlassian.com.

      Cheers,
      Azwandi

  4. Jan 15

    Jeremy Page says:

    Will the {include} and {exclude} macros function in earlier versions of confluen...

    Will the {include} and {exclude} macros function in earlier versions of confluence?

    Having trouble getting the macro to use only one or two images in the gallery - wondering if I'm doing something wrong or it's just not in the Conf 2.7.3 version.

    1. Jan 20

      Azwandi Mohd Aris says:

      The macro has been improved since Confluence 2.9, part of the Advanced Macros pl...

      The macro has been improved since Confluence 2.9, part of the Advanced Macros plugin (bundled plugin). Hence, I am afraid that this updated macro is not available for Confluence 2.7.3. Hope that helps.

  5. Jan 16

    William Lubelski says:

    Is there any way to force a redraw of the thumbnails used in the gallery? When u...

    Is there any way to force a redraw of the thumbnails used in the gallery? When uploading a new version of an image, the thumbnail will show the old version.

    If the two images are different aspect ratios, it does this crazy thing where it's the old image with the new image's proportions.

    Only seems to happen with uplaoding new versions of an image using the same filename.  Our current workaround is to rename each offending file from "filename.jpg" to "filename_a.jpg" or something like that, so that the system uses it as a "new" image.  This is however somewhat tedious with large sets of images.

    -Will

    1. Jan 20

      Komathi Krishnan [Atlassian] says:

      Hi William, I am afraid that this problem is due to your browser cache rather t...

      Hi William,

      I am afraid that this problem is due to your browser cache rather than Confluence. What I would suggest is try holding the shift key and click on the refresh button for your page.If this didn't help I suggest you to raise a support request on this issue at http://support.atlassian.com/.

      Cheers,
      Komathi

  6. Mar 17

    David Vitek says:

    does the reverseSort work doesn't look like it works {gallery:title=Hero Imag...

    does the reverseSort work

    doesn't look like it works

    {gallery:title=Hero Images for Opt Out Newsletter|sort=comment|reverseSort|columns=2}
    
    1. Mar 19

      Zed Yap [Atlassian] says:

      Hi David, I have tried this: {gallery:title=Hero Images for Opt Out Newslet...

      Hi David,

      I have tried this:

      {gallery:title=Hero Images for Opt Out Newsletter|sort=comment|reverseSort|columns=2}
      

      The reverse sort will work fine if the uploaded image have comment on it. Perhaps, you might want to clarify further on this?

      Hope that helps

      1. Mar 19

        David Vitek says:

        i think i have done everything correctly but it doesnt seem to resort. i couldn...

        i think i have done everything correctly but it doesnt seem to resort.

        i couldnt attach images to this wiki so i uploaded to a another server to help clarify what i am doing

        http://www.homeimprovementpages.com.au/media_library/sort_bug_1.png

        http://www.homeimprovementpages.com.au/media_library/sort_bug_2.png

        http://www.homeimprovementpages.com.au/media_library/sort_bug_3.png

        any help is much appreciated

        1. Mar 20

          Zed Yap [Atlassian] says:

          Hi David, I could not replicate your problem, I would recommend you to raise a ...

          Hi David,

          I could not replicate your problem, I would recommend you to raise a support ticket in our Atlassian support system:

          By raising a support ticket, this may speed up the process to overcome this issue. Also, please attach your instance's
          application server log and atlassian-confluence.log.

  7. Jun 17

    Phillip Ankerson says:

    I am creating an employee directory and I want the thumbnail to link to a person...

    I am creating an employee directory and I want the thumbnail to link to a personal space.  Any chance?

    1. Jun 18

      Zed Yap [Atlassian] says:

      Hi Philip, As far as I know, you can try this method: [!apple1.jpg!|try:Home...

      Hi Philip,

      As far as I know, you can try this method:

      [!apple1.jpg!|try:Home]
      

      !apple1.jpg! is the attachment image in a page
      try = Space key of a space
      Home = Page title

      For more in formation on linking please refer to this documentation:

      Hope that helps.
      Best rgds,
      Zed

  8. Jun 22

    Anonymous says:

    Hello, we using the "old" 2.10.2 confluence wiki-software. When I try to use the...

    Hello,
    we using the "old" 2.10.2 confluence wiki-software. When I try to use the gallery macro with 165 pictures, none of them are displayed.
    I don't know what can be wrong. These pictures are all fine (.jpg and .JPG).

    Any ideas? Thank you very much!

Add Comment


Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 2.5 Australia License.