Confluence Docs 3.0 : Displaying List of Attachments in a Page This page last changed on Jun 01, 2009 by ggaskell. Use Confluence's Attachments Macro to display a list of attachments that belong to the current page. It will generate a table like the image shown below. Screenshot: List of attachments from 'Attachments' macro, including Office documents with 'View' link On this page: Usage with the Macro Browser Usage with the Wiki Markup Editor Parameters Examples 1. Filter Attachments by File Name 2. Include Old Attachments Viewing the List of Attachments Attachment Information Icon ## Usage with the Macro Browser To insert the attachments 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 attachments macro, click 'insert' to add it to your page. ## Usage with the Wiki Markup Editor
What you need to type | What you will get
--- | ---
{attachments} |
| Name | Size | Creator (Last Modifier) | Creation Date | Last Mod Date | Comment |
--- | --- | --- | --- | --- | --- | --- | ---
| office1.jpg | 94 kB | Vidya Madabushi | Aug 09, 2005 | Aug 09, 2005 |  |
| waterfall.jpg | 1.27 MB | Vidya Madabushi | Aug 09, 2005 | Aug 09, 2005 |  |
| editProfile.png | 33 kB | Sarah Maddox [Atlassian Technical Writer] | Oct 08, 2007 | Oct 08, 2007 |  |
## 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 (`:`).
Parameter | Default | Description
--- | --- | ---
Filename Patterns (`patterns`) | all | Specify which attachments to display using filename patterns.
Include Old Attachment Versions (`old`) | false | Include old attachments versions in the list.
Sort By (`sortBy`) | date | Specify the sort order for attachments. Valid values are "date", "size" and "name".
Allow Upload (`upload`) | false | Adds functionality to allow the upload of new attachments.
## Examples #### 1. Filter Attachments by File Name
    {attachments:patterns=.*jpg,.*gif}
Use a comma-separated list of regular expressions to specify the filenames of the attachments you want displayed.
| Note The patterns are regular expressions, so to match a file suffix of 'jpg', use .*jpg, not *.jpg.
Here's a detailed tutorial on regular expressions. #### 2. Include Old Attachments
    {attachments:old=true}
An optional true/false value determines whether to show old versions of attachments. This is set to false by default. ## Viewing the List of Attachments When you view the page, you will see a list of attachments. When the attachment is an Office document, you will see a 'View' link as shown in the screen snippet below. Screenshot: List of attachments from 'Attachments' macro, including Office documents with 'View' link Click the 'View' link to view the content of the Office document within Confluence. If you have an Office application installed, you will also be able to launch your Office editor from within Confluence. See Displaying an Office Document in Confluence and Working with the Office Connector. ## Attachment Information Icon When a page you are viewing contains attachments, a small paperclip icon like this: appears next to the page byline. Clicking the paperclip will take you to the 'Attachments View', where the full list of attachments is displayed. ##### RELATED TOPICS Working with Attachments Overview Working with Macros Take me back to the Confluence User Guide. Attachments: waterfall.jpg (image/jpeg) office1.jpg (image/jpeg) editProfile.png (image/png) editProfile.png (image/png)

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