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

For example, I've attached a file x.png to this page

x.png

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

MoinMoin: macro/AttachmentLink.py (last edited 2007-10-29 19:08:58 by localhost)