clear
From QED
| ↑ | ||
| ← Editing | Peak/Sandbox/clear | Refresh → |
One way to support navigation between pages is using templates. Three specific templates are described on this page.
Please note that "white space" (blanks and new lines) are significant in templates.
Contents |
Table of Contents
| Title |
| Related topics |
| See also |
A simple but often effective way to support navigation is with a table of contents defined using a template. What makes this method attractive is that the MediaWiki engine modifies the highlighting of the current page — notice that in the illustrative TOC on the right, the reference to this page (at the very bottom of the TOC) is not a hyperlink (it is rendered in black), even though the template defines it as a hyperlink.
Thus, the specification of the TOC has only to be done once. The same template can then be included on each page without any modification.
To use this kind of template, start with Template:Meta/TableOfContents as a guide.
Previous-Next Templates
The navigational bar at the top of this page was generated by a "previous-next" template. The main advantages and disadvantages of this kind of template are as follows:
- Cons
- each page must invoke the template in a slightly different way
- insertion or deletion of a single page in a chain requires several updates
- Pros:
- for very large groups of pages, the navigation bar presents less clutter than a TOC
- if there is a naturally linear ordering, using a "previous-next" template makes it easy for editors to create the next page — just click on the right-arrow.
Template:PreviousNext
The navigational bar at the top of this page was generated using the template Template:PreviousNext as follows:
{{PreviousNext|Contents|Editing|Refresh}}
The full name of the template is given first, then the name of the "Up" page, and finally the names of the previous and next pages. The namespace is implicit in all cases — in the present instance, Help:.
Template:navbar
For pages in the same subdirectory (e.g. Course:/GEO206/2006) the navbar template may be more convenient as it saves having to repeat the subdirectory name. The syntax is slightly different:
{{navbar|Base|Previous Page|Current Page|Next Page}}
The Base page specification determines the directory in which the other pages are located. For example, given the following specification in the Course: namespace:
{{navbar|GEO206/2006|January|February|March}}
the back-arrow would become a link to the page: "Course:GEO206/2006/January".
See also
For examples of how templates can help, see:












