wiki:AttachmentNumMacro

Version 4 (modified by martin_s, 4 years ago) (diff)

--

Link to Local Attachments by Number

Description

This macro allows to link to attachment of the current wiki or ticket by number, which is useful for generic pages etc.

Configuration

Put the following code into your Trac configuration file trac.ini:

[components]
tracattachmentnum.* = enabled

[attachmentnum]
# Optional default settings
raw = True
format = short
# ATM format is only 'short' or 'long' (default)

Example

[[AttachmentNum(1)]]                # First attachment, result: "attachment:'first.doc'".
[[AttachmentNum(1,raw=True)]]       # First attachment (raw link), result: "raw-attachment:'first.doc'".
[[AttachmentNum(1,format=short)]]   # First attachment, hyper-linked filename is printed only, result: "first.doc".

Bugs/Feature Requests

Existing bugs and feature requests for AttachmentNumMacro are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out AttachmentNumMacro from here using Subversion, or browse the source with Trac.

Recent Changes

[8542] by martin_s on 2010-08-30 23:57:24
Added encoding meta-comment and declared SVN keywords as unicode to avoid issues with non-english locales.
[8417] by martin_s on 2010-08-23 13:11:23
Removed outdated variable rev from setup file.
[8379] by martin_s on 2010-08-20 15:22:36
Removed import of source revisions to avoid installation issues.

Author/Contributors

Author: martin_s
Contributors: