|
|
Line 1: |
Line 1: |
| <includeonly><!--
| | {{delete}} |
| # The first step is to check whether this is a category page
| | poopoo peepee template |
| -->{{Category other<!--
| |
| -->|<!-- ############### It is a category ###############################
| |
| # So check that it matches the required format: "YYYY births" or "YYYY deaths"
| |
| -->{{#ifeq: {{#expr: {{#invoke:String|find|{{PAGENAME}}|^A?D? ?%d%d?%d?%d? ?B?C? births$|plain=false}} +
| |
| {{#invoke:String|find|{{PAGENAME}}|^A?D? ?%d%d?%d?%d? ?B?C? deaths$|plain=false}} }}<!--
| |
| -->|0<!--
| |
| -->|<!-- # Doesn't match
| |
| -->{{Error|Invalid page name.<br />[[Template:Year births or deaths category header]] is for use only on category pages whose title is of the form {{nowrap|"YYYY births"}} or {{nowrap|"YYYY deaths"}}, where "YYYY" is a year (e.g. "1201 births", "2021 deaths", "265 births", or "12 BC deaths")}}<!--
| |
| -->[[Category:Errors reported by other category header templates]]<!--
| |
| -->|<!--
| |
| -->{{Year births or deaths category header/core<!--
| |
| -->|year={{#invoke:String|replace|{{PAGENAME}}|pattern=^A?D? ?(%d%d?%d?%d? ?B?C?) (%l+)$|%1|1|false}}<!--
| |
| -->|bc={{#ifexpr: {{#invoke:String|find|{{PAGENAME}}|BC|plain=false}} > 0|1}}<!--
| |
| -->|type={{#invoke:String|replace|{{PAGENAME}}|pattern=^A?D? ?(%d%d?%d?%d? ?B?C?) (%l+)$|%2|1|false}}<!--
| |
| -->}}<!--
| |
| -->}}<!--
| |
| -->|<!-- ############### Not a category ###############################
| |
| -->{{Error|This page is not in the [[Research Realm:Namespace|category namespace]].<br />[[Template:Year births or deaths category header]] is for use only on category pages whose title is of the form {{nowrap|"YYYY births"}} or {{nowrap|"YYYY deaths"}}, where "YYYY" is a year (e.g. "1201 births", "2021 deaths", "265 births", or "12 BC deaths")}}<!--
| |
| | |
| -->[[Category:Errors reported by other category header templates]]<!--
| |
| -->}}<!--
| |
| # Legacy templates required parameters while this one does not. Place those pages in this tracking category to clean up
| |
| -->{{#if:{{{1}}}|[[Category:Pages using year births or deaths category header with parameters]]}}</includeonly><!--
| |
| # Note {{Automatic category TOC}} needs to be available whether or not this template page has been transcluded
| |
| -->{{Automatic category TOC}}<!--
| |
| --><noinclude><!--
| |
| -->{{Documentation}}
| |
| </noinclude>
| |