This is the template sandbox page for Template:Person categories (diff). See also the companion subpage for test cases. |
This template should always be substituted (i.e., use {{subst:Person categories}} ). |
{{Person categories}}
or its shortcut {{L}}
(from the original name "Lifetime") is for automatically generating all category tags related to birth and death years, including living people and missing or unknown values. The general DEFAULTSORT can be embedded as well. It should not be used to replace existing DEFAULTSORT and/or category tags.
{{subst:L|year of birth|year of death|sort key}}
will generate:
{{DEFAULTSORT:sort key}}
[[Category:BIRTH births]]
[[Category:DEATH deaths]]
Other cases are handled with options, see below. As with the original, the embedded magic word DEFAULTSORT also applies to all categories on the page, no matter whether the lifetime template is before or after them.
Since the {{DEFAULTSORT:}}
should occur before the categories, the L template should generally be placed before the first Category tag, for example:
{{subst:L|year of birth|year of death|sort key}}
[[Category:ABC]]
[[Category:XYZ]]
For each option, the default value is displayed in bold and automatically assumed if the field is left blank.
Please note that MISSING results in Categories that are not displayed on the page.
Most values are case-insensitive ("LIVING" or "LiVinG" work the same), except when it matters (such as century names).
{{subst:L|1899||Surname, Name}}
or
{{subst:L|1899|LIVING|Surname, Name}}
will give:
{{DEFAULTSORT:Surname, Name}}
[[Category:1899 births]]
[[Category:Living people]]
{{subst:L|||Surname, Name}}
or
{{subst:L|MISSING|LIVING|Surname, Name}}
will give:
{{DEFAULTSORT:Surname, Name}}
[[Category:Year of birth missing (living people)]]
[[Category:Living people]]
{{subst:L|1899|1986|Surname, Name}}
will give:
{{DEFAULTSORT:Surname, Name}}
[[Category:1899 births]]
[[Category:1986 deaths]]