Template:Navlist/Link

From Wikibooks, open books for an open world
< Template:Navlist
Jump to: navigation, search
Template documentation[edit] [history] [purge]

Usage[edit]

This template generates a link to a given page {{{1}}}. By default, the visible name of the link is the page's subpagename. If the page parameter {{{1}}} is blank (or omitted), no link is generated (and &nbsp; is generated instead). There are also four optional named parameters, {{{left}}} {{{right}}} {{{mode}}} and {{{prefix}}}.

If a link is generated, and {{{left}}} and/or {{{right}}} is provided, the parameter value(s) is(are) generated to the left/right of the link. If a link is generated, {{{prefix|}}} is prefixed to the name of the link (both to its address, and to its visible name before taking its subpagename).

Parameter {{{mode}}} overrides the default visible name of the link. If mode=long, the visible name is all but the book-name and following slash (except that the main page itself is given its own name, rather than blank). If mode=split, the long visible name is divided into two lines just before the subpagename.

Some examples (see note on editing):

Code Generates Looks like
{{Template:Navlist/Link|Book|prefix=Wikijunior:}} [[Wikijunior:Book|Book]] Wikijunior:Book
{{Template:Navlist/Link|Book/Chapter|prefix=Wikijunior:}} [[Wikijunior:Book/Chapter|Chapter]] Chapter
{{Template:Navlist/Link|Book/Chapter|left=←&nbsp;}} ←&nbsp;[[Book/Chapter|Chapter]] ← Chapter
{{Template:Navlist/Link|left=←&nbsp;}} &nbsp;  
{{Template:Navlist/Link|left=←&nbsp;|prefix=Template:}} &nbsp;  
{{Template:Navlist/Link|Book/Chapter/Section|mode=long}} [[Book/Chapter/Section|Chapter/Section]] Chapter/Section
{{Template:Navlist/Link|Book/K/L/Module|mode=split}} [[Book/K/L/Module|K/L<br/>Module]] K/L
Module