Confluence Docs 3.0 : Gallery Macro This page last changed on Jul 12, 2009 by ggaskell. 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 Usage with the Wiki Markup Editor Some office photos, and a waterfall Parameters Examples Basic Usage, Specifying Number of Table Columns Excluding an Image Specifying the Images to be Included Specifying a Page Name Sorting the Images by File Name Sorting the Images to Show Most-Recently-Modified First ## Usage with the Macro Browser To insert the gallery macro into a page using the Macro Browser, Open your desired Confluence page, then click the 'Edit' button. The 'Edit Page' mode opens. Next, click the Macro Browser icon on the editor toolbar. The Macro Browser will open in the middle of the screen. 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
#### Some office photos, and a waterfall
|  | Here's an office photo |
|  |  | Here is the waterfall photo
## 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 Displaying a Thumbnail Image Attaching Files to a Page Editing Attachment Details Working with Macros Take me back to the Confluence User Guide. Attachments: harbour2.jpg (image/jpeg) harbour3.jpg (image/jpeg) office10.jpg (image/jpeg) office11.jpg (image/jpeg) office3.jpg (image/jpeg) office1.jpg (image/jpeg) office2.jpg (image/jpeg) waterfall.jpg (image/jpeg)

Document generated by Confluence on Nov 05, 2009 23:35