Code source wiki de View File Macro
Modifié par Admin le 16/10/2025 - 23:33
Masquer les derniers auteurs
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | The view-file macro displays attachments in a document, in place or as thumbnail and offers a preview. |
| 2 | |||
| 3 | Limitation: the thumbnail is actually only an icon for now. | ||
| 4 | |||
| 5 | = Parameters = | ||
| 6 | |||
| 7 | |=Parameter|=Description|=Required|=Default | ||
| 8 | |display|Kind of display. "button" for a button, "thumbnail" for a thumbnail, "full" to render the document in place|no|thumbnail (button in inline mode) | ||
| |
7.1 | 9 | |name|The attachment reference to display|if att--filename is not given| |
| |
6.1 | 10 | |page|The page from where you want the attachments to be displayed. Modifying this parameter will reset the selected file value|no| |
| |
1.1 | 11 | |width|The width of the view in % or px (e.g. 100%, 100px)|no|100% for the full view or 100px for the thumbnail |
| 12 | |height|The height of the view in % or px (e.g. 100%, 100px)|no|1000px for the full view or 100px for the thumbnail | ||
| |
7.1 | 13 | |att--filename|Alias of name|If name is not given| |
| |
1.1 | 14 | |
| 15 | = Example Usage = | ||
| 16 | |||
| 17 | Thumbnails side by side: | ||
| 18 | |||
| 19 | {{view-file display="thumbnail" name="Test.ppt"/}} {{view-file display="thumbnail" name="TestPDF.pdf"/}} | ||
| 20 | |||
| 21 | Or standalone: | ||
| 22 | |||
| 23 | {{view-file name="Test.ppt"/}} | ||
| 24 | |||
| 25 | In a paragraph: {{view-file name="Test.ppt"/}} | ||
| 26 | |||
| 27 | |||
| 28 | Full PDF: | ||
| 29 | |||
| 30 | {{view-file display="full" name="TestPDF.pdf"/}} | ||
| 31 | |||
| 32 | Full Presentation: | ||
| 33 | |||
| 34 | {{view-file display="full" name="Test.ppt"/}} | ||
| 35 |