3,237 bytes added
, 15:41, 4 April 2022
<includeonly><!--
# The first step is to check whether this is a category page
-->{{Category other<!--
-->|<!-- ############### It is a category ###############################
# So check that it matches the required format: "YYY0s establishments" or "YYY0s disestablishments"
# No regexes, so check separately for "establishments" and "disestablishments"
# In each case, the find function returns 0 for a nomatch, and 1 for a match,
# so we add the two together and take a total of 0 as an error
-->{{#ifeq: {{#expr: {{#invoke:String|find|{{PAGENAME}}|^%d?%d?%d?0s establishments$|plain=false}} + <!--
-->{{#invoke:String|find|{{PAGENAME}}|^%d?%d?%d?0s disestablishments$|plain=false}} }}<!--
-->|0<!--
-->|<!-- # Doesn't match
-->{{Error|Invalid page name.<br />[[Template:(Dis)establishments in decade category header]] is for use only on category pages whose title is of the form {{nowrap|"YYY0s establishments"}} or {{nowrap|"YYY0s disestablishments"}}, where YYY0s is an AD decade (e.g. "0s", "90s", "760s" or "1840s"}}<!--
-->[[Category:Errors reported by other category header templates]]<!--
-->|<!--
-->{{(Dis)establishments in decade category header/core<!--
-->|decade={{#invoke:String|replace|{{PAGENAME}}|pattern=^(%d?%d?%d?0)s (d?i?s?establishments)$|%1|1|false}}<!--
-->|type={{#invoke:String|replace|{{PAGENAME}}|pattern=^(%d?%d?%d?0)s (d?i?s?establishments)$|%2|1|false}}<!--
-->}}<!--
-->}}<!--
-->|<!-- ############### Not a category ###############################
-->{{Error|This page is not in the [[Wikipedia:Namespace|category namespace]].<br />[[Template:(Dis)establishments in decade category header]] is for use only on category pages whose title is of the form {{nowrap|"YYY0s establishments"}} or {{nowrap|"YYY0s disestablishments"}}, where YYY0s is an AD decade (e.g. "0s", "90s", "760s" or "1840s"}}<!--
-->[[Category:Errors reported by other category header templates]]<!--
-->}}</includeonly><!--
# Note {{CatAutoTOC}} needs to be available whether or not this template page has been transcluded
-->{{CatAutoTOC}}<!--
--><noinclude><!--
-->{{Documentation|content=<!--
-->To make a category of the form "YYY0s establishments" or "YYY0s disestablishments", where YYY0s is a decade
e.g.
* [[:Category:0s establishments]]
* [[:Category:90s establishments]]
* [[:Category:760s establishments]]
* [[:Category:1840s establishments]]
* [[:Category:0s disestablishments]]
* [[:Category:40s disestablishments]]
* [[:Category:910s disestablishments]]
* [[:Category:2010s disestablishments]]
==Usage==
<code><nowiki>{{(Dis)establishments in decade category header}}</nowiki></code>
No parameters needed
== Redirects ==
* {{tl|Disestablishments in decade}}
* {{tl|Establishments in decade}}
== See also ==
* [[Template:(Dis)establishments in year category header]]
}}
[[Category:Establishments-and-disestablishments-by-decade dual-purpose templates| ]]
</noinclude>