Template:Person in year/doc

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

A decade navigational box for "{Person} in {Year}" categories

Usage

{{Person in year |1= |2= |3= |4= }}

The first three parameters represent the name of a person. These parameter values plus the fourth parameter (the year) should match the name of the category you are placing this template on (e.g. your category should be titled Category:{1} {2}{3} in {4}).

This template will automatically set a default sort key value to enable sorting by last name (e.g. {{DEFAULTSORT:{2}, {1}{3}}}). It will also add the category Category:{1} {2}{3} by year. If that category doesn't exist, it will add Category:{1} {2}{3} instead. (See the byyear parameter for more info.) Both of these functions can be disabled by including the nocat=1 parameter.

Template parameters

ParameterDescriptionDefaultStatus
1first nameFirst (and middle) name(s) of the person (leave blank for mononymous people)emptyoptional
2last nameLast name of the person (use this parameter for mononymous people)emptyrequired
3name suffixA suffix after the name, including punctuation (e.g. , Jr.). If your suffix begins with a space, you must either use unnamed parameters (e.g. don't include 3= at the beginning), or use the character code for a space:  .emptyoptional
4yearThe year number (BC years not supported)emptyrequired
nocatno categoriesSet to 1 to disable automatic inclusion of categories.0optional
byyear
by
use 'by year' category?Set to 1 to use "Category:{Person} by year" as the parent category, or set to 0 to use "Category:{Person}" as the parent category. By default, the template will automatically pick the parent category based on whether or not "Category:{Person} by year" exists. (In general, you should not set this parameter at all unless you are running into issues with too many expensive parser function calls.)emptyoptional
Template data
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

A decade navigational box for "{Person} in {Year}" categories

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
first name1

First (and middle) name(s) of the person (leave blank for mononymous people)

Lineoptional
last name2

Last name of the person (use this parameter for mononymous people)

Linerequired
name suffix3

A suffix after the name, including punctuation (e.g. ", Jr."). If your suffix begins with a space, you must either use unnamed parameters (e.g. don't include "3=" at the beginning), or use the character code for a space: "&amp;#32;".

Lineoptional
year4

The year number (BC years not supported)

Numberrequired
use 'by year' category?byyear by

Set to "1" to use "Category:{Person} by year" as the parent category, or set to "0" to use "Category:{Person}" as the parent category. By default, the template will automatically pick the parent category based on whether or not "Category:{Person} by year" exists. (In general, you should not set this parameter at all unless you are running into issues with too many expensive parser function calls.)

Booleanoptional
no categoriesnocat

Set to "1" to disable automatic inclusion of categories.

Default
0
Booleanoptional

Additional information

The template is intended to be used in the following namespaces: the Category namespace

The template is intended to be used by the following user groups: all users

Placement: At the top of the page

Relies on:
{{Decade years navbox}}

Example

{{Person in year|Cristiano|Ronaldo||2009}}

renders as:

See also

Localization

This template is not intended to be localized.