Code source wiki de Confluence bridge for Attachments
Modifié par Admin le 16/10/2025 - 23:33
Afficher les derniers auteurs
| author | version | line-number | content |
|---|---|---|---|
| 1 | = Description = | ||
| 2 | |||
| 3 | This macro is a bridge for the Confluence Attachment macro. It uses the XWiki implementation to display attachments in the page content. | ||
| 4 | |||
| 5 | The following parameters are not supported for now: | ||
| 6 | |||
| 7 | * {{{ labels }}}, because XWiki does not support attachment tags | ||
| 8 | * {{{ preview }}}, because attachments are displayed differently in XWiki | ||
| 9 | * {{{ old }}}, because it doesn't really make sense in XWiki | ||
| 10 | |||
| 11 | Additionally, the {{{ "created date" }}} value of the {{{ sortBy }}} property behaves the same way as the {{{ "date" }}} value | ||
| 12 | |||
| 13 | = Parameters = | ||
| 14 | |||
| 15 | |=Parameter|=Description|=Required|=Default | ||
| 16 | |**patterns**|Comma-separated list of regular expressions, used to filter attachments by name.|No| | ||
| 17 | |**sortBy**|Sort attachments by {{{ date }}}, {{{ size }}} or {{{ name }}}|No|{{{ date }}} | ||
| 18 | |**sortOrder**|Sort attachments in {{{ ascending }}} or {{{ descending }}} order|No|{{{ ascending }}} | ||
| 19 | |**upload**|Allow users to attach new files|No|{{{ true }}} | ||
| 20 | |**page**|Pages containing the attachments to display. Current page if empty.|No| | ||
| 21 | |||
| 22 | = Example Usage = | ||
| 23 | |||
| 24 | |||
| 25 | {{code}} | ||
| 26 | {{confluence_attachments | ||
| 27 | patterns=".*png" | ||
| 28 | sortBy="name" | ||
| 29 | /}} | ||
| 30 | {{/code}} |