Templat:Kehidupan
{{DEFAULTSORT:{{{3}}}}}
[[Kategori:Kelahiran {{{1}}}]]
[[Kategori:Kematian {{{2}}}]]
Kegunaan
[sunting sumber]{{Kehidupan}}
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.
{{Kehidupan|tahun kelahiran|tahun kematian|kunci susunan}}
will replace:
{{DEFAULTSORT:kunci susunan}}
[[Kategori:Kelahiran KELAHIRAN]]
[[Kategori:Kematian KEMATIAN]]
Other cases are handled with options, see below. As with the original, the embedded magic word DEFAULTSORT also applies to all categories listed below the template.
This template supports optional substitution. If you want to substitute it, use the following syntax:
{{subst:Kehidupan|year of birth|year of death|sort key|subst=subst:}}
Since Categories are preferred to be listed in most-common order, the Kehidupan template should generally be placed after the last Category tag, for example:
[[Kategori:ABC]]
- :
[[Kategori:XYZ]]
{{Kehidupan|tahun kelahiran|tahun kematian|kunci susunan}}
Options
[sunting sumber]For each option, the default value is displayed in bold and automatically assumed if the field is left blank.
- 1 (kelahiran)
-
- HIALNG : when year seems possible to be found.
- TAKDIKETAHUI : when year seems unlikely to be found (pre-19th century).
- kelahiran : seperti "1899" atau "1890-an" or "abad ke-19" (known approximations).
- 2 (kematian)
-
- HIDUP : living or assumed living people.
- HILANG : believed dead and year seems possible to be found.
- TAKDIKETAHUI : when year seems unlikely to be found (pre-19th century).
- tahun kematian : seperti "1986" atau "1980-an" atau "abad ke-20" (known approximations).
- 3 (kunci susunan)
-
- {{PAGENAME}} : should usually never be left blank (especially with Asian names, it is hard to make the difference between a missing sortkey and a sortkey identical to the article name due to a family-first name).
- Asian name, Honorific prefix (qualifier suffix) : for assertion of sortkey assessment.
- Family name, Given name, Honorific-prefix (qualifier suffix) : for proper sorting.
- "Newton, Isaac, Sir" - "Karlsson, Ove (sports journalist)"
- For further details, see Wikipedia:Pengkategorian orang#Ordering names in a category.
Most values are case-insensitive ("LIVING" or "LiVinG" work the same), except when it matters (such as century names).
Contoh
[sunting sumber]- Untuk orang yang hidup
{{Kehidupan|1899||Surname, Nama}}
atau
{{Kehidupan|1899|LIVING|Surname, Nama}}
atau
{{Kehidupan|1899|HIDUP|Surname, Nama}}
akan menggantikan:
{{DEFAULTSORT:Surname, Nama}}
[[Kategori:Kelahiran 1899]]
[[Kategori:Orang hidup]]
- Untuk orang yang hidup tetapi hilang kelahiran
{{Kehidupan|||Surname, Nama}}
atau
{{Kehidupan|MISSING|LIVING|Surname, Nama}}
atau
{{Kehidupan|HILANG|HIDUP|Surname, Nama}}
akan menggantikan:
{{DEFAULTSORT:Surname, Nama}}
[[Kategori:Tahun kelahiran hilang (orang hidup)]]
[[Kategori:Orang hidup]]
- Untuk orang yang mati
{{Kehidupan|1899|1986|Surname, Nama}}
akan menggantikan:
{{DEFAULTSORT:Surname, Nama}}
[[Kategori:Kelahiran 1899]]
[[Kategori:Kematian 1986]]
- Untuk kelahiran purba tidak dicatatkan oleh sejarah
{{Kehidupan|UNKNOWN|abad ke-12|Surname, Nama}}
atau
{{Kehidupan|TAKDIKETAHUI|abad ke-12|Surname, Nama}}
akan menggantikan:
{{DEFAULTSORT:Surname, Nama}}
[[Kategori:Tahun kelahiran tidak diketahui]]
[[Kategori:Kematian abad ke-12]]
- Dan sebagainya.
Teknikal
[sunting sumber]Sebelum mengubahkan kod atau teks templat itu, sila pastikan isi-isi yang harus disimpan:
- The template's name and its aliases are in all-caps and feature the suffix -SORT so as to clue in editors that it embeds and replaces DEFAULTSORT. (The original alias "BD" was renamed and is unlisted for the same reason.)
- The seemingingly useless extra bars in the switch statements are for empty values.
- Extra whitespace around years doesn't matter, because MediaWiki strips whitespace from each end of template parameters. Calls such as
{{Kehidupan| 1899 |}}
will, therefore, still work with Category:1899 births despite the extra whitespace.
The template provides a local sandbox and testcases for developing and testing changes (see documentation's hatnote).
Lihat juga
[sunting sumber]- Bantuan:Kategori#Kunci susunan lalai, tentan kategori dan DEFAULTSORT
- Bantuan:Perkataan ajaib#Parser functions, tentang DEFAULTSORT secara teknikal