| 1 | = Link to Local Attachments by Number = |
| 2 | |
| 3 | == Description == |
| 4 | |
| 5 | This macro allows to link to attachment of the current wiki or ticket by number, which is useful for generic pages etc. |
| 6 | |
| 7 | = Configuration = |
| 8 | Put the following code into your Trac configuration file `trac.ini`: |
| 9 | {{{ |
| 10 | [components] |
| 11 | tracattachmentnum.* = enabled |
| 12 | |
| 13 | [attachmentnum] |
| 14 | # Optional default settings |
| 15 | raw = True |
| 16 | format = short |
| 17 | # ATM format is only 'short' or 'long' (default) |
| 18 | }}} |
| 19 | |
| 20 | |
| 21 | |
| 22 | == Bugs/Feature Requests == |
| 23 | |
| 24 | Existing bugs and feature requests for AttachmentNumMacro are |
| 25 | [report:9?COMPONENT=AttachmentNumMacro here]. |
| 26 | |
| 27 | If you have any issues, create a |
| 28 | [http://trac-hacks.org/newticket?component=AttachmentNumMacro&owner=martin_s new ticket]. |
| 29 | |
| 30 | == Download == |
| 31 | |
| 32 | Download the zipped source from [download:attachmentnummacro here]. |
| 33 | |
| 34 | == Source == |
| 35 | |
| 36 | You can check out AttachmentNumMacro from [http://trac-hacks.org/svn/attachmentnummacro here] using Subversion, or [source:attachmentnummacro browse the source] with Trac. |
| 37 | |
| 38 | == Example == |
| 39 | |
| 40 | {{{ |
| 41 | [[AttachmentNum(1)]] # First attachment, result: "attachment:'first.doc'". |
| 42 | [[AttachmentNum(1,raw=True)]] # First attachment (raw link), result: raw-attachment:'first.doc'. |
| 43 | [[AttachmentNum(1,format=short)]] # First attachment, hyper-linked filename is printed only, result: "first.doc". |
| 44 | }}} |
| 45 | |
| 46 | |
| 47 | == Recent Changes == |
| 48 | |
| 49 | [[ChangeLog(attachmentnummacro, 3)]] |
| 50 | |
| 51 | == Author/Contributors == |
| 52 | |
| 53 | '''Author:''' [wiki:martin_s] [[BR]] |
| 54 | '''Contributors:''' |