Displaying a list of images attached to the current page
Let's find all the images that are attached to the current page and list them out in a table.
Looking for Confluence Cloud recipes?
This recipe is for the Confluence Server & Data Center version of the app. If you are interested in Reporting for Confluence Cloud recipes, refer to this page.
Ingredients
Apps | Reporting |
---|---|
Platform | Server |
Macros | |
Suppliers |
Guide
- Create a Report Table macro.
- Within that Report Table macro, create an Expanding Reporter macro.
For the Key parameter, type "content:images".
For the As parameter, type "at". - Within the Expanding Reporter macro, create a Local Reporter macro.
For the Key parameter, type "@self". - Below the Local Reporter macro, create a Text Sort macro.
For the Key parameter, type "attachment:title". - Now, still within the Report Table macro, but under the Expanding Reporter macro, create a Report Column macro.
For the Title parameter, type "File Name". - Within the File Name Report Column macro, create a Report Info macro.
For the Key, type in "expanded:at > attachment:file name".
Be sure to also check Link to Item. - Under the File Name Report Column macro, create another Report Column macro.
For the Title parameter, type "Image". - Within the Image Report Column macro, create a Report Image macro.
For the Key, type in "expanded:at".
You may also want to set the dimension limits. For the purpose of this example, we set both Height and Width to "100px". - Under the Image Report Column macro, create a Report Empty macro.
Within the macro, type "No files have been attached to this page." - You should now have something that looks like this:
- Click Save and check out the results.
Results
File Name | Image |
---|---|
Argentina.gif |
|
Koi.gif |
|
report-table.png |
|
reportinglogo.jpg |
|
Shamisen.gif |
|