]> sipb.mit.edu Git - ikiwiki.git/blob - doc/forum/Doing_related_links_based_on_tags.mdwn
typo
[ikiwiki.git] / doc / forum / Doing_related_links_based_on_tags.mdwn
1 I've been recently using a template this
2
3     ----
4     Related posts:
5
6     \[[!inline pages="blog/posts/*
7             and !blog/posts/*/*
8             and !Discussion
9             and !tagged(draft)
10             and <TMPL_VAR raw_tagged>"
11             archive="yes"
12             quick="yes"
13             show="5"]]
14
15 Which I then call by doing this at the end of my blog posts on my
16 ikiwiki install
17
18     \[[!tag software linux]]
19     \[[!template id=related tagged="tagged(software) or tagged(linux)"]]
20
21 It somewhat works, I was wondering if anyone else has tried to do
22 something like the above to get "related posts" based on tags. The way
23 that I have done it isn't very clever as it only links to the last 5
24 most recently posted items based on my parameters. Is it possible to
25 "randomly" select a bunch of links from a set of user defined
26 pagespecs?
27
28 I know that the [[backlinks]] plugin exists for this sort of stuff
29 (related links), it just lacks some user configuration options.
30
31 > I guess what you need is an extension to [[ikiwiki/pagespec/sorting]] to support "random" as a sort method.  Remember though, that the chosen few would only change when the page was regenerated, not on every page view. -- [[Jon]]