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.

Ingredients

Guide

  1. Create a Report Table macro.

  2. Within that Report Table macro, create an Expanding Reporter macro.
    For the Key parameter, type "content:images".
    For the As parameter, type "at".

  3. Within the Expanding Reporter macro, create a Local Reporter macro.
    For the Key parameter, type "@self".

  4. Below the Local Reporter macro, create a Text Sort macro.
    For the Key parameter, type "attachment:title".

  5. 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".

  6. 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.

  7. Under the File Name Report Column macro, create another Report Column macro.
    For the Title parameter, type "Image".

  8. 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".

  9. Under the Image Report Column macro, create a Report Empty macro.
    Within the macro, type "No files have been attached to this page."

  10. You should now have something that looks like this:




  11. Click Save and check out the results. 

Results

File NameImage

Argentina.gif

Koi.gif

report-table.png

reportinglogo.jpg

Shamisen.gif