WP:Navigation template
{{hatnote|For the navigation template guideline, see Wikipedia:Categories, lists, and navigation templates § Navigation templates.}}
{{hatnote|For the Navbox template page, see Template:Navbox}}
{{redirect|WP:NAV|navigational popups|WP:NAVPOP|polling in discussions|WP:NOTVOTE}}
{{Supplement|interprets=Wikipedia:Categories, lists, and navigation templates guideline|WP:NAV}}
{{nutshell|A navigation template links between existing articles belonging to the same topic on English Wikipedia. There are two types: "navigation boxes" (or navboxes) and "sidebars".}}{{Linking and page manipulation|linking and diffs}}
A navigation template is a grouping of links used in multiple related articles to facilitate navigation between those articles. Editing of a navigation template is done in a central place, the template page.
There are two main varieties of navigation template: navigation boxes (or navboxes), designed to sit at the very bottom of articles, and sidebars, designed to sit at the side of the article text. The two are complementary and either or both may be appropriate in different situations.
The usual way to create navigation templates is to use the {{tl|navbox}} or {{tl|sidebar}} master templates. This simplifies the process of creating a functional and consistent template.
Do not rely solely on navboxes for links to articles highly relevant to a particular article. Navboxes are not displayed on the mobile website for Wikipedia, which accounts for around half of readers. See Phabricator ticket {{Phab|T124168}} for progress on the mobile issue. See Phabricator ticket {{Phab|T124168}} for work on making navboxes' appearance better on mobile.
Navboxes are categorized under :Category:Navigational boxes. Some WikiProjects maintain a list of their navigation templates.
Types
The two main types of navigation template are navboxes and sidebars. The two serve similar purposes: to allow related subjects to link to each other easily in a consistent manner.
=Navboxes=
Navboxes are footer templates that sit below the standard article appendices and are laid out horizontally. They are created using the {{tl|navbox}} template. An example navbox template, {{tl|named sapphires}}, is shown below:
{{named sapphires|state=expanded}}
=Sidebars=
{{geodesy}}
Sidebars sit alongside content, in the same manner as infoboxes, and are predominantly laid out vertically. They are created using the {{tl|sidebar}} template. An example sidebar, {{tl|geodesy}}, is shown to the right:
=Usage=
The two types are used interchangeably, and either or both may be appropriate in different circumstances. The primary differences between the two are:
- Navboxes are laid out horizontally, and so work best for longer lists of links in a small number of sub-categories. As they are placed at the very bottom of articles, they are better for broader lists of links than would be appropriate in a sidebar. Articles often have more than one navbox and content may overlap to a degree: nevertheless, not everything needs a navbox, so navbox templates should only be created when they would be genuinely useful as navigational tools.
- Sidebars are laid out predominantly vertically, and are placed relatively prominently in the body of articles alongside the text. This makes them useful for smaller amounts of directly relevant links. Tangential information should be kept out of sidebars. Few articles have more than one sidebar.
Properties
The style of any navigation template depends on its articles, how they are most intuitively presented, and previously established convention.
= Navigation templates are not arbitrarily decorative =
{{Shortcut|WP:NAVDECOR|WP:NAVCOLOR|WP:NAVCSS|WP:NAVIMAGES}}
{{See also|Wikipedia:Manual of Style/Icons}}
- There should be justification for a template to deviate from the colors and styles contained in Module:Navbox/styles.css and Module:Sidebar/styles.css.
- Per MOS:DECOR, images are rarely appropriate in navboxes. Just like colors and styles, they should have a justification to appear. Specifically, there should be no national or regional flags or coats of arms. A rare example of an appropriate image is this: a map shows (in green) the location of a region within the state of Kazakhstan, and this is consistently implemented for all state's regions.
- There are two basic layouts:
- On the right side of page—for example {{tl|History of China}}.
- For meta-template, see {{tl|sidebar}}
- Footer boxes—for example {{tl|Health in China}}, designed to appear at the bottom of each article, stacked with other similar templates. See also: Wikipedia:Footers for information on placement
- For footer boxes, {{tl|Navbox}} is the standard.
- Existing hard-coded collapsible elements should be converted to one of the templates in :Category:Collapse templates. This standardizes the look and eases future maintenance.
- The width of footer boxes should be 100% unless the convention for that type of article is otherwise. It looks inconsistent if multiple boxes in the same article have varying widths.
Advantages
{{see also|Wikipedia:A navbox on every page#Benefits of navboxes|Wikipedia:Categories, lists, and navigation templates#Advantages}}
Advantages of using navigation templates rather than listing all the links under "See also" sections include:
- reduction of clutter in that area of the article before "References" and "External links",
- compactness of the template compared to a standard list or table, in the case of many links,
- if the most immediately related links are kept under "See also", the reader has a better idea of scope,
- less directly related links are out of the way or in some cases hidden by default,
- ease of maintenance in updating the template as articles get created or deleted,
- aesthetically pleasing appearance to many users,
- new articles in a subject area immediately gain the basic link structure of existing related articles, eliminating the need for many editors to individually build up their own links and rewrite background material.
- when a new article or an older article that was orphaned is placed in a navbox, the page instantly has a large number of links to it
Alternatives
In certain cases, there are alternatives preferable over the creation of a new navigation template.
- If the group of articles overlaps significantly with an existing category or stand-alone list, consider adding a link to one of these to the see also section.
- For a series of articles whose only shared characteristic is that they hold the same position or title, such as peerage or world champion sporting titles, consider using {{tl|succession box}}. Variant templates for persons who have held several notable offices are discussed at Template talk:Succession box.
- For relating articles across different categories in a logical sequence, use a succession template.
- Use one of these Hatnotes: {{Tl|Broader}}, {{Tl|Further}} or {{Tl|Main}}.
- Create an outline: a hierarchical list.
Template limits
{{main|Help:Templates#Template limits}}
There are limits to the number of templates an article may have. When a page exceeds this limit it may look fine in preview but, after the edit is saved, one or more footer navboxes display as wikilinks to the now excess navboxes (for example, displaying a link to "Template:Navbox" rather than the Navbox template itself). Solutions for this problem include (a) removing a template, and (b) setting up the footer navboxes so the least important one becomes the "extra" navbox (the one the reader will have to navigate to a separate page to in order to view).
See also
- Wikipedia:Template namespace for an introduction to templates
- Wikipedia:Requested templates for help in editing templates
- Wikipedia:Categories, lists, and navigation templates, for an actual guideline on the subject
- Wikipedia:Template index, for other types of templates
- Wikipedia:Manual of Style/Infoboxes
- Wikipedia:Article series, related information
- Wikipedia:Series templates, related information
- Wikipedia:A navbox on every page, an essay
- Wikipedia:Not everything needs a navbox, another essay
- Wikipedia:Navigational boxes redirects here; to view the historical archive, see Wikipedia:Navigational boxes (archive)
- Wikipedia:Redirect#Bypass redirects in navigational templates
- Wikipedia:WikiProject Navigation templates
- {{tl|Quicktemplates}}, a table of templates
- {{tl|Wikipedia editor navigation}}, an amalgamation of navboxes
{{Navigation templates}}
{{Wikipedia templates}}