Template:Navigation by

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Navigation by/doc.

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:

  1. a number of metatemplates for various criteria used to build navigation lists
  2. this template which is used as a wrapper around 1. to create the actual navigation templates, and
  3. 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

ParameterDescriptionDefaultStatus
1Criterion for navigation, i.e. metatemplate to useemptyrequired
aboveFixed text to output above the actual navigation list. Only used for style=box.emptyoptional
belowFixed text to output below the actual navigation list. Only used for style=box.emptyoptional
itemWikidata item ID to use as the starting point for the list of navigation items. Only used for dynamic metatemplates.emptyoptional
title:patternLike 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.
emptyoptional
title:hyphenLike 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.
emptyoptional
title:theLike 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.
emptyoptional
patternName 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.
emptyrequired
hyphenIf 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.
nooptional
theIf 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.
yesoptional
redlinksHow to handle red links to nonexisting category pages:
yes
show red links
no
hide red links
When defining a new template, use {{{redlinks|yes}}} to allow the caller to define this and default to yes.
yesoptional
styleDisplay style of the navigation list:
box
standalone navigation box with title and border
inline
a borderless navigation box which can be embedded e.g. in a table
list
just the item list to embed it into a Navbox with several navigations
When defining a new template, use {{{style|box}}} to allow the caller to define this and default to box.
boxoptional

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.