Attachment 'Up.py'
Download 1 """
2 MoinMoin - Up Macro
3
4 Written by Daniela Nicklas <dani@miracle-solutions.de>
5
6 Useful for Subpages: inserts a link to move up one level, e.g. from
7 FirstLevel/SecondLevel to FirstLevel. If the page is no subpage, link goes to Frontpage
8 """
9
10 from MoinMoin.Page import Page
11 from MoinMoin import config
12 import sys
13 import cStringIO
14 import string
15
16 def execute(macro, args):
17
18 pagename = macro.formatter.page.page_name
19 plist = string.split(pagename, "/");
20 pagename = ""
21
22 if len(plist) == 1:
23 pagename = config.page_front_page
24 else:
25 # last element is omitted
26 plist = plist[:-1]
27 pagename = string.join(plist, "/");
28
29 p = Page(pagename);
30
31 content = p.link_to()
32
33 return content
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.