1 [[!template id=plugin name=trail author="[[Simon_McVittie|smcv]]"]]
4 This plugin provides the [[ikiwiki/directive/trailoptions]],
5 [[ikiwiki/directive/traillink]], [[ikiwiki/directive/trailitem]],
6 and [[ikiwiki/directive/trailitems]] [[directives|ikiwiki/directive]].
8 It's sometimes useful to have "trails" of pages in a wiki where each
9 page links to the next and/or previous page. For instance, you could use
10 this for a guided tour, sequence of chapters, or sequence of blog posts.
12 In this plugin, a trail is represented by a page, and the pages in the
13 trail are indicated by specially marked links within that page, or by
14 including groups of pages with a [[ikiwiki/directive]].
16 If using the default `page.tmpl`, each page automatically displays the
17 trails that it's a member of (if any), with links to the trail and to
18 the next and previous members. HTML `<link>` tags with the `prev`,
19 `next` and `up` relations are also generated.
21 The [[ikiwiki/directive/trailoptions]] directive sets options for the
24 Pages can be included in a trail in various ways:
26 * The [[ikiwiki/directive/inline]] directive with `trail="yes"` sets up an
27 [[inline]], and at the same time adds the matching pages (from `pages` or
28 `pagenames`) to the trail. One use is to navigate through all posts in
31 \[[!inline pages="page(./posts/*) and !*/Discussion" archive=yes
32 feedshow=10 quick=yes trail=yes]]
34 This only works if the trail and [[!iki plugins/inline desc=inline]]
35 plugins are both enabled.
37 * The [[ikiwiki/directive/trailitems]] directive has optional `pages` and
38 `pagenames` options which behave the same as in [[inline]], but don't
39 produce any output in the page, so you can have trails that don't list
42 * The [[ikiwiki/directive/traillink]] directive makes a visible link
43 and also adds the linked page to the trail. This will typically be
44 used in a bullet list, but could also be in paragraph text:
46 * [[!traillink Introduction]]
47 * [[!traillink "Chapter 1"]]
48 * [[!traillink Chapter_2]]
49 * [[!traillink Appendix_A]]
53 To use this software you must \[[!traillink install]] it,
54 \[[!traillink configuration text="configure it"]],
55 and finally \[[!traillink running|run_it]].
57 This also counts as a [[ikiwiki/WikiLink]] for things like the `link()`
58 [[ikiwiki/PageSpec]] item.
60 * The [[ikiwiki/directive/trailitem]] directive adds a page to the trail
61 like `traillink`, but produces an invisible link, rather like `\[[!tag]]`:
63 To use this software you must \[[!traillink install]] it,
64 \[[!trailitem installing_from_packages]]
65 \[[!trailitem installing_from_source]]
66 \[[!traillink configuration text="configure it"]],
67 and finally \[[!traillink running|run_it]].
68 \[[!trailitem troubleshooting]]
70 Like `\[[!tag]]`, this still counts as a [[ikiwiki/WikiLink]] even though
71 there's no visible link.
73 You can mix several of these directives in one page. The resulting
74 trail will contain all of the pages matched by any of the directives,
75 in the same order that the directives appear (unless you use the `sort` or
76 `reverse` options on `\[[!trailoptions]]`).