Template:Navigation by
A family of metatemplates for category navigation boxes populated from Wikidata
Usage
{{Navigation by
|1 =
|item =
|pattern =
|redlinks =
|style =
}}
The template family Navigation by facilitates the creation of category navigation boxes which are populated from Wikidata. The text displayed in the resulting navigation boxes will be derived from Wikidata labels in the user's language, so they will be fully translated into all languages available in Wikidata. At the same time, output is formatted using the standard Navbox module, which means that the navigation boxes are nestable and consistent in design.
The family consists of:
- a number of metatemplates for various criteria used to build navigation lists
- this template which is used as a wrapper around 1. to create the actual navigation templates, and
- all the actual navigation templates built with 1. and 2.
It is not recommended to use this template directly in a category page for navigation. Instead, you can use one of the actual templates derived from this one, or you can build a new navigation template as described below.
Available metatemplates and their actual templates
criterion | metatemplate variant | Wikidata property | actual templates |
---|---|---|---|
administrative division | dynamic | contains the administrative territorial entity (P150) Used only for administrative entities |
list |
month | static | - | {{Navigation by months}} |
period | dynamic | has part(s) (P527) | (none) |
season | static | - | {{Navigation by seasons}} |
settlement | dynamic | contains settlement (P1383) Used for settlements within the lowest level of administrative divisions |
list |
If you want to add more metatemplates, please see the documentation of {{Navigation by/Wikidata}}.
Creating a new navigation template
From a static metatemplate
To create a new navigation template from a static metatemplate, you create a new template following the naming scheme Navigation by criterions
with the following content:
<includeonly><onlyinclude>{{Navigation by|criterion | pattern = {{{pattern|<<criterion>>}}} | redlinks = {{{redlinks|yes}}} | style = {{{style|box}}} }}</onlyinclude></includeonly> {{Documentation|content={{Navigation by/templatedoc|variable=criterion|pattern=example pattern}}}} [[Category:Category navigational templates|Criterions]] [[Category:Internationalised navigational templates|Criterions]] [[Category:Criterions|~Navigation]]
- criterions
- Plural identification of the criterium for the navigation bar, for example
months
. - criterion
- Singular identification of the criterium for the navigation bar, must match the metatemplate name, for example
month
. - example pattern
- Pattern to use in the example in the template documentation, for example
Trees in <<month>>
.
Everything else must be copied verbatim.
See the parameter list below for some optional additional parameters, and {{Navigation by months}} for an example of a navigation template built from a static metatemplate.
Please note that for each static metatemplate, usually there exists exactly one actual navigation template.
From a dynamic metatemplate
To create a new navigation template from a dynamic metatemplate, you create a new template following the naming scheme Navigation by criterions
with the following content:
<includeonly><onlyinclude>{{Navigation by|meta-criterion | item = Wikidata item ID | pattern = {{{pattern|<<variable>>}}} | redlinks = {{{redlinks|yes}}} | style = {{{style|box}}} }}</onlyinclude></includeonly> {{Documentation|content={{Navigation by/templatedoc|meta=meta-criterion|variable=variable|pattern=example pattern}}}} [[Category:Category navigational templates|Criterions]] [[Category:Internationalised navigational templates|Criterions]] [[Category:Criterions|~Navigation]]
- criterions
- Plural identification of the specific criterium for this navigation bar, for example
states of Austria
. - meta-criterion
- General criterium of the metatemplate, for example
administrative division
. - Wikidata item ID
- Wikidata item ID to use for compiling the navigation list, for example
Q40
for Austria (Q40). - variable
- Variable to use for category name patterns, for example
state
. - example pattern
- Pattern to use in the example in the template documentation, for example
Churches in <<state>>
.
Everything else must be copied verbatim.
See the parameter list below for some optional additional parameters, and {{Navigation by states of Austria}} for an example of a navigation template built from a dynamic metatemplate.
For each dynamic metatemplate, many different actual navigation templates can be built.
Template parameters
Parameter | Description | Default | Status | |
---|---|---|---|---|
1 | Criterion for navigation, i.e. metatemplate to use | empty | required | |
above | Fixed text to output above the actual navigation list. Only used for style=box . | empty | optional | |
below | Fixed text to output below the actual navigation list. Only used for style=box . | empty | optional | |
item | Wikidata item ID to use as the starting point for the list of navigation items. Only used for dynamic metatemplates. | empty | optional | |
title:pattern | Like pattern (see below), but used for the title item. This allows the title item to have a different pattern from the navigation items.When defining a new template where you want to use this feature, use {{{title:pattern|}}} to allow the caller to define this. | empty | optional | |
title:hyphen | Like hyphen (see below) in the case that title:pattern is used.When defining a new template where you want to use this feature, use {{{title:hyphen|}}} to allow the caller to define this. | empty | optional | |
title:the | Like the (see below) in the case that title:pattern is used.When defining a new template where you want to use this feature, use {{{title:the|}}} to allow the caller to define this. | empty | optional | |
pattern | Name pattern for the links to which the navigation items will point. Any variable enclosed in << and >> will be replaced by the correct link target.When defining a new template, use {{{pattern|<<variable>>}}} (for example {{{pattern|<<state>>}}} ) to allow the caller to define this. | empty | required | |
hyphen | If this parameter is set to yes , the name of all navigation items will be changed by replacing blanks by hyphens. For example, “20th century” will become “20th-century”.When defining a new template where you want to use this feature, use {{{hyphen|}}} to allow the caller to define this. | no | optional | |
the | If this parameter is set to yes , the name of some navigation items (as defined in Module:Navigation by Wikidata/special rules) will be prefixed with a “the”. For example, “Netherlands” will become “the Netherlands”.When defining a new template where you want to use this feature, use {{{the|yes}}} to allow the caller to define this and default to yes . | yes | optional | |
redlinks | How to handle red links to nonexisting category pages:
{{{redlinks|yes}}} to allow the caller to define this and default to yes . | yes | optional | |
style | Display style of the navigation list:
{{{style|box}}} to allow the caller to define this and default to box . | box | optional |
Additional information
The template is intended to be used in the following namespaces: the Template namespace
The template is intended to be used by the following user groups: all users
Relies on:
See also
Localization
This template is localized by utilizing Wikidata, via {{Label}} template or similar approach.