macro/AttachmentLink.py is a macro that I hacked out, based on macro/ImageLink.py by Jeff Kunce. I'm not a Python programmer, but I did manage to get the thing to work to where I'm happy with it.
Usage
[ [ AttachmentLink( url to link to, attachment name, optional parameters) ] ]
Where
- Url to link to - an external site
AttachmentName - this can be on the current page (just use the name) or on another page (pagename/attachmentname)
- Optional Parameters - options such as "border=0" are very handy.
For example, I've attached a file x.png to this page
If you wanted to build a link to mike.warot.com, based on this, for example, you could then put
[ [ AttachmentLink(http://mike.warot.com,x.png,border=0) ] ]
Or if the attachment is on a different page (for example, the FrontPage)
[ [ AttachmentLink(http://mike.warot.com,FrontPage/x.png,border=0) ] ]
August 17, 2003 -- MikeWarot
To make it work with MoinMoin 1.2 change line 101 from
1 imgsrc = '<img src="%s"%s>'%(AttachFile.getAttachUrl(pagename,imgurl,0),kwstring)
to
1 imgsrc = '<img src="%s"%s>'%(AttachFile.getAttachUrl(pagename,imgurl,macro.request),kwstring)
2004-06-14 -- AnttiKuntsi