Attachment 'randompage-linktext.patch'
Download 1 diff --git a/plugin/macro/RandomPage.py b/plugin/macro/RandomPage.py
2 index b97cd1d..9622b45 100644
3 --- a/plugin/macro/RandomPage.py
4 +++ b/plugin/macro/RandomPage.py
5 @@ -13,7 +13,9 @@ from MoinMoin.Page import Page
6
7 Dependencies = ["time"]
8
9 -def macro_RandomPage(macro, links=1):
10 +# Generate links random pagelinks. If links is 1, linktext can be used to
11 +# override the link text.
12 +def macro_RandomPage(macro, links=1, linktext=None):
13 request = macro.request
14 links = max(links, 1) # at least 1 link
15
16 @@ -44,7 +46,7 @@ def macro_RandomPage(macro, links=1):
17 if links == 1:
18 name = pages[0]
19 return (f.pagelink(1, name, generated=1) +
20 - f.text(name) +
21 + f.text(linktext or name) +
22 f.pagelink(0, name))
23
24 # return a list of page links
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.