I want to add a table to a Confluence page, which should contain an entry for all attachments below the current position, alike the Space-Attachment macro did.
@Hans-Joachim Fritz I believe that this macro was removed in the Cloud version because the functionality is available by selecting Space Settings > Manage Content > Attachments.
Does this page meet your needs? Or do you need to display the information on an actual page in your space?
To be honest, yes, I need to have a table with all the confluence pages below the actual page and a table with all the attachments in the pages below.
But thanks very much, you solution s a workaround at least.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Hans-Joachim Fritz
You might try our User Macro for Confluence Cloud app.
It gives full control over data that will be shown in macro. So any customization you need could be implemented there.
I have created a general macro for your use case that lists all attachments from the current space.
It gives additional information which might be useful along with preview and download links.
Here is how it looks like on the page:
And here is the code which could be altered to your needs as you wish:
#set( $query = "type=attachment and space=${space.key}" )
#set( $expand = "extensions,version" )
#set( $url = "/wiki/rest/api/content/search?limit=250&expand=${expand}&cql=${query}")
#set( $attachments = $ConfluenceManager.get($url).results )
<table class="aui aui-table-sortable">
<thead>
<tr>
<th> </th>
<th> Filename </th>
<th> Filetype </th>
<th> Created On </th>
<th> Created By </th>
<th> Size </th>
</tr>
</thead>
<tbody>
#foreach ( $att in $attachments )
<tr>
<td>
<a href="${baseUrl}${att._links.download}"><span class="aui-icon aui-icon-small aui-iconfont-download"></span></a>
</td>
<td>
<a href="${baseUrl}${att._links.webui}">$att.title</a>
</td>
<td> $att.extensions.mediaType </td>
<td> $att.version.friendlyWhen </td>
<td>
<a href="${baseUrl}/people/${att.version.by.accountId}"><span class="aui-lozenge">${att.version.by.publicName}</span></a>
</td>
#set ( $kb = $att.extensions.fileSize / 1024 )
<td> $kb kB </td>
</tr>
#end
</tbody>
</table>
As creators of the app, we can adjust macro to your needs.
Additionally, the app is quite powerful and you can do many more things with it.
Let me know if it suits your needs,
Roman, Wombats Corp
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you very much for your effort, but I am looking for somehow standard solution. I'm simply not able or grantet rights to use this macro. Anyway thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.