On this page
Overview
The Attachment Table macro produces a table of attachments based on various selection criteria, including powerful space and page selection.
Further customization is possible by specifying filters to select attachments by name, comment content, and labels. You can select and indicate the order in which columns are to be displayed based on their column name or number. Refer to Columns Available to Display for details.
The resulting table can be customized and supports most common table capabilities.
Depending on the selection criteria used and number of attachments, pages, and spaces that need to be processed, this could be a long running process. Choose your selection criteria carefully and consider using the Cache Macro to limit the number of times the attachment list generation needs to be done and/or the Future Macro to defer processing. The limit parameter described below can also be used to limit processing.
Feature Video
Basic Use
This macro can be deployed using one of the following methods:
Selected from the Macro Browser | Attachment Table |
|---|---|
Markup Shortcut | {attachment-table} |
Screenshot
Parameters
Click a column heading to toggle the sorting of that column.
Refer to Using Regex Expressions To Select Attachments to learn how to form the regular expressions that are supported by several parameters below.
Parameter | Default | Macro Browser Label | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
page | current page | Page to list attachments from | Simple way to find a single page and display it's attachments. Use a page title (in the current space) or preface the title with *SPACEKEY:* if the page is in a different space. This parameter takes precedence over the other page selection parameters. Leave blank to use spaceRegex and pageRegex instead. | ||||||
spaceRegex |
| Space key or space name regex | A regular expression (regex) pattern to match on space keys or space names. Used in combination with the pageRegex parameter to select pages from which attachments will be chosen. @self can be used to identify the current space. If spaceRegex is left blank, the page parameter is required. | ||||||
includePersonalSpaces | false | Include personal spaces | Use to determine whether personal spaces matching the spaceRegex should be included or not. | ||||||
pageRegex |
| Page name regex | A regular expression (regex) pattern to match on page names (titles). Used in combination with the spaceRegex parameter to select pages from which attachments will be chosen. | ||||||
pageLabelRegex |
| Page label regex | A regular expression (regex) pattern to match on page labels. Used in combination with the pageRegex and spaceRegex parameters to select pages from which attachments will be chosen. Pages must match all selection criteria. | ||||||
attachmentRegex |
| Attachment name regex | A regular expression (regex) pattern to match on attachment names. Used in combination with the commentRegex and labelRegex parameters to select attachments. Attachment must match all selection criteria. | ||||||
commentRegex |
| Attachment comment regex | A regular expression (regex) pattern to match on attachment comments. Used in combination with the attachmentRegex and labelRegex parameters to select attachments. Attachment must match all selection criteria. | ||||||
labelRegex |
| Attachment label regex | A regular expression (regex) pattern to match on attachment labels. Used in combination with the attachmentRegex and commentRegex parameters to select attachments. Attachment must match all selection criteria. Matching technique is determined by the labelMatchOption parameter. | ||||||
labelMatchOption | single | Label match option | Indicates the manner in which to apply the labelRegex parameter (for attachments) and the pageLabelRegex parameter (for pages) when looking for matching labels.
| ||||||
columns | default columns | Columns to show | Comma separated list of column names or numbers in any order. When blank, a default set of columns is shown. Columns are enumerated starting at 1. See Columns Available for Display below for a list of columns. | ||||||
textForNone |
| Text to display when no attachments match | Indicates the text that should be displayed when no attachments are found that match the search criteria. | ||||||
dateFormat | Confluence default | Date format | Date format for created and modified columns. Use a simple date format string. | ||||||
limit | 1000 | Limit number of attachments to retrieve | Processing stops after the number of attachments found matching the selection criterial reaches the limit value. Space, page, and attachment processing is ordered by name. |
Common Parameters
The Attachment Table macro allows the user to select the columns to be displayed as well as the order. A default set of columns is displayed unless an explicit list is provided. You can select and indicate the order in which columns are to be displayed based on their column name or number. Use the columns parameter to specify a comma separated list of column names or numbers.
Please note that column names are case insensitive.
In most cases the column heading can be used in place of the column name, but there are a few cases where that is ambiguous. In this case, the first column matching the heading will be used.
Default columns for single page attachments | file, size, creator, created, comment |
|---|---|
Default columns for multiple page attachments | page, file, size, creator, created, comment |
Examples
Other Macros
Below is a list of all other Macros available within this Add-on:
Additional References
Need support? Create a request with our support team.
