Template:Simple Page Navigation/doc
This is a documentation subpage for Template:Simple Page Navigation It contains usage information, categories and other content that is not part of the original template page. |
This template is used on 400+ pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Usage
editThe examples below of the new and old parameter names attempt to illustrate the relationship between the two by generating the same navigation links using each of them. The theory of operation behind the change to the new syntax was primarily to split each of the old parameters into a link target and a display name, the same way that a piped wikilink has the hidden link target on the left of the pipe and the display text to the right.
Templates that require parsed wikicode to be supplied to the parameters (as in the case of needing to supply complete wikilinks to the old syntax) are brittle by nature and fail to make use of some of the most powerful advantages offered by the MediaWiki parser. This has hopefully been addressed and the new syntax currently offers much better logic for determining which pages to link when parameters are left unset, as well as several new ways to manipulate its visual appearance. |
New syntax
edit{{Simple Page Navigation | book = Wikibooks:Templates | prev = Wikibooks:Templates/Deletion | next = Wikibooks:Templates/User pages | book_disp = Templates | prev_disp = Deletion | next_disp = User pages | current = Navigation | bgcolor = PaleTurquoise | bordercolor = SlateBlue | borderstyle = groove | borderwidth = 0.75em }} |
▶▶▶▶ Parsed Output ▶▶▶▶ |
|
The new syntax has introduced the ability to manipulate its appearance using CSS3 declarations as well, which is also demonstrated above. To learn more about what values are valid to pass to those parameters, see the TemplateData section below. |
Old syntax (deprecated)
edit{{Simple Page Navigation | BookName=[[Wikibooks:Templates|Templates]] | CurrentPage=Navigation | PrevPage=[[Wikibooks:Templates/Deletion|Deletion]] | NextPage=[[Wikibooks:Templates/User pages|User pages]] }} |
▶▶▶▶ Parsed Output ▶▶▶▶ |
|
This shows the template with all of its styling parameters at their defaults. |
TemplateData
editTemplateData for Simple Page Navigation
Creates a centered, rectangular navigation box showing the name of the current page and with links to the previous and next pages in a book, as well as the book's main page, or any other valid pages supplied to its parameters
Parameter | Description | Type | Status | |
---|---|---|---|---|
Book target | book | The full page name (and namespace, if necessary) of the book's main page
| Page name | suggested |
Previous page target | prev | The full page name (and namespace, if necessary) of the previous page in the book | Page name | required |
Next page target | next | The full page name (and namespace, if necessary) of the next page in the book | Page name | required |
Book link text | book_disp | The text you wish to be linked to the book's main page. (optional) | Line | suggested |
Previous page link text | prev_disp | The text you wish to be linked to the previous page in the book. (optional) | Line | optional |
Next page link text | next_disp | The text you wish to be linked to the next page in the book. (optional) | Line | optional |
Current page display text | current CurrentPage | The text you wish to appear unlinked beneath the book name, if not the actual {{SUBPAGENAME}} of the page it appears on. (optional)
| Line | optional |
Background color | bgcolor | The color used to fill inside the box's border and behind its contents; can be formatted as: CSS color name keywords, #rrggbb[aa] red-green-blue 8-bit hexadecimal numbers [with optional transparency] or your choice of rgb(red, green, blue[, transparency]) or hsl(hue, saturation, lightness[, transparency]) 8-bit decimal numbers.
| Line | optional |
Border color | bordercolor | The color used for the box's border; can be formatted as: CSS color name keywords, #rrggbb[aa] red-green-blue 8-bit hexadecimal numbers [with optional transparency] or your choice of rgb(red, green, blue[, transparency]) or hsl(hue, saturation, lightness[, transparency]) 8-bit decimal numbers.
| Line | optional |
Border style | borderstyle | One of the eight (four 2D and four 3D) border styles defined in CSS3, or 'none'. The two-dimensional styles are: 'solid', 'dashed', 'dotted' and 'double'. The three-dimensional styles perform an algorithmic color shift to the defined border color and apply it asymetrically along both axes to achieve their effect and are named: 'groove', 'ridge', 'inset' and 'outset'.
| Line | optional |
Border width | borderwidth | A measurement of the desired width of the box's border, formatted as a floating point decimal value followed immediately by the symbol or abbreviation for one of the 15 valid CSS3 units of distance (five absolute and ten relative to the user's device/display environment, though the absolute units are discouraged from use on WikiBooks as they are intended primarily for material to be physically printed) with no whitespace between them. The relative units are: '%' (percentage of parent object's size on the same axis), 'em' (width of lowercase m at page's default font size), 'rem' (width of lowercase m at browser's default text size), 'px' (display pixels, integer values only), 'vw', 'vh', 'vmin', 'vmax' (percentage of: display width, height, or smaller and larger of the display axes, respectively), 'ex' (height of lowercase x at page's default font size) and 'ch' (width of 0 at page's default font size). Absolute units are: 'pc' (picas), 'pt' (points), 'cm' (centimeters), 'mm' (millimeters) and 'in' (inches).
| Line | optional |
Book link | BookName | Accepts a (piped) wikilink to the book's main page, include the double square brackets on each end.
| Content | deprecated |
Previous page link | PrevPage | Accepts a (piped) wikilink to the book's previous page, include the double square brackets on each end. | Content | deprecated |
Next page link | NextPage | Accepts a (piped) wikilink to the book's next page, include the double square brackets on each end. | Content | deprecated |