blob: bac8dd72fd16bcfe199d572b0379253adca9f061 [file] [log] [blame]
version=pmwiki-2.0.beta28 ordered=1
newline
agent=Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1
author=JBMarc
host=80.126.97.171
name=PmWiki.WikiTrails
rev=19
targets=PmWiki.WikiTrails,PmWiki.PmWiki,PmWiki.WikiStyles,PmWiki.GroupHeader,PmWiki.GroupHeaders,PmWiki.PageHistory,PmWiki.DocumentationIndex
text=The WikiTrails feature allows wiki authors to create "trails" through sequences of pages in the wiki.²²!!!Creating a trail²²To create a trail, an author creates a "trail index page" that gives the sequence of page names as either a bullet or numbered list. The page names must be the first item following each bullet.²²To give an example for the function of the trail index page: A [[WikiTrail(s)]] like² [=² * [[TrailPage1]]² * Some text * [[TrailPage2]]² ** [[TrailPage3]]² ** [[TrailPage4]] some other text [[IrrelevantWikiPage]]² ** Yet some other text. [[AnotherIrrelevantWikiPage]] =]²²creates the following "trail":²² [=WikiPage1 <-> WikiPage2 <-> WikiPage4 <-> WikiPage4 =]²²Observations:²²# Indentation levels in the page list don't matter. PmWiki simply transforms it into a linear list of pages.²# Text that isn't a link doesn't matter, too.²# Only the first link in a list item matters, and only if no non-link text precedes it.²²!!!Using the trail²²Creating the trail doesn't do anything actually. In fact any page with numbered or bulleted lists will implicitly create a trail, intentionally or not. What makes the trail "work" is adding the appropriate markup on the trail pages (i.e. those pages that are listed in the bullet/numbered list).²²To acknowledge a page for the trail, add the markup [=<<|TrailIndexPage|>>=] somewhere on it. You can place the markup anywhere you like, and in as many places as you like; good places are at the top and/or bottom of each trail page.²²When a page with such a markup is displayed, PmWiki does the following things:²²# Extract a list of pages (the "trail") from bulleted/numbered list items in [@TrailIndexPage@].²# Displays something like "[=<< PreviousPage | TrailIndexPage | NextPage >>=]", where `PreviousPage and `NextPage are links to the previous and next pages as listed in the trail.²# If the current page doesn't exist in the trail, displays simply [=<<|TrailIndexPage|>>=].²²Trail page markup can be varied in various ways:²²* You can use @@^@@ instead of @@<<...>>@@ like this: [@^|TrailIndexPage|^@]. This will not display the previous and next page in the list, instead it will show a "breadcrumb trail" that shows "how to get here": first the trail index page, then the name of the page itself. If the page was on a subitem in the bullet/numbered list, the last item of the list will also show. Taking the example trail index above, trail page 2 would display [=TrailIndexPage | TrailPage2=], trail page 3 would display [=TrailIndexPage | TrailPage2 | TrailPage3=], and on trail page 4 it would be [=TrailIndexPage | TrailPage2 | TrailPage4=].²* A single @@<|...|>@@ will not display arrows at the "ends" of the trail (where a page is the first or last page in the trail).²* Enclosing the name of the trail index page as in [@<|[[TrailIndexPage]]|>@] will turn it into a link in the text that PmWiki generates. (Normally it isn't.)²* Other double square bracket variations work as well, such as [@<|[[TrailIndexPage | Nicer text for trail index page]]|>@]²²!!!Fun Stuff with trails²²Normally, a trail is a linear list with a first and a last item. However, you can make it circular by adding the first item at the end of the trail index page:²² [=² * [[TrailPage1]]² * [[TrailPage2]]² ...² * [[TrailPageN]]² * [[TrailPage1]]² =]²²If the trail index page is intended to be visible to end users, you might want to hide that last list item that closes the circle. In that case, simply make it invisible:²² [=² * [[TrailPage1]]² * [[TrailPage2]]² ...² * [[TrailPageN]]² * [[TrailPage1]] %item comment =]²²!!!Other notes²²The @@[=%trail%=]@@ markup used in PmWiki's documentation pages is just a [[WikiStyle(s)]] that creates a grey background, and is not required for WikiTrails to work. It's defined in the PmWiki.GroupHeader page.²²You can embed brackets inside a trail as in [=<<|[[PmWiki/Documentation Index]]|>>=] or [=<<|[[PmWiki/Documentation Index | Up]]|>>=]. ²²%trail%<<|PmWiki.DocumentationIndex|>>
time=1113220584