Jump to content

Template:Establishment category in country: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Typo
start switchover to version without year parameters
Line 1: Line 1:
<includeonly><!--
{{EstcatCountry/checkuse}}{{YearInCountryPortalBox|{{{3|}}}|{{{4|}}}|{{{5|}}}|year={{{1}}}{{{2}}}}}
# The first step is to check whether this uses the old-style year parameters, of the form {{EstcatCountry| YYY | Y | country [ | sort key [ | new name ]] }}
{{Category explanation|organizations, places and other things founded or established in '''[[{{#if:{{{dab|}}}|{{{dab}}}{{!}}|}}{{{3}}}]]''' in the year '''[[{{#ifexpr:{{{1}}}{{{2}}} < 10|AD {{{1}}}{{{2}}}|{{{1}}}{{{2}}}}}]]'''}}
# The new form is {{EstcatCountry| country [ | sort key [ | new name ]] }}
{| class="toccolours" style="margin:1em auto;"
# If it is then all parameters should be passed to the old template ... if not, then use the new core
|{{LinkCatIfExists2|{{{1}}}0s establishments in {{{3}}}|{{{1}}}0s establishments in {{{3}}}}}:
#
|{{#ifexpr: {{{1}}}0 < 10 ||{{LinkCatIfExists2|{{#expr: {{{1}}}0 - 1}} establishments in {{{3}}}|&larr;}} {{LinkCatIfExists2|{{{1}}}0 establishments in {{{3}}}|{{{1}}}0}} •&nbsp;}}{{LinkCatIfExists2|{{{1}}}1 establishments in {{{3}}}|{{{1}}}1}} •&nbsp;{{LinkCatIfExists2|{{{1}}}2 establishments in {{{3}}}|{{{1}}}2}} •&nbsp;{{LinkCatIfExists2|{{{1}}}3 establishments in {{{3}}}|{{{1}}}3}} •&nbsp;{{LinkCatIfExists2|{{{1}}}4 establishments in {{{3}}}|{{{1}}}4}} •&nbsp;{{LinkCatIfExists2|{{{1}}}5 establishments in {{{3}}}|{{{1}}}5}} •&nbsp;{{LinkCatIfExists2|{{{1}}}6 establishments in {{{3}}}|{{{1}}}6}} •&nbsp;{{LinkCatIfExists2|{{{1}}}7 establishments in {{{3}}}|{{{1}}}7}} •&nbsp;{{LinkCatIfExists2|{{{1}}}8 establishments in {{{3}}}|{{{1}}}8}} •&nbsp;{{LinkCatIfExists2|{{{1}}}9 establishments in {{{3}}}|{{{1}}}9}} {{LinkCatIfExists2|{{#expr: {{{1}}}9 + 1}} establishments in {{{3}}}|&rarr;}}
# We check this by concatenating the first 2 parameters, and then checking that they are all digits.
|}
-->{{#ifeq: {{#invoke:String|match|s={{{1}}}{{{2}}}|pattern=^%d%d%d%d?$|start=1|match=1|plain=false|nomatch=%%nomatch%%}}|%%nomatch%%<!--

-->|<!--
{{Category see also if exists 2|{{{1}}}{{{2}}} disestablishments in {{{3}}}|{{{1}}}0s disestablishments in {{{3}}}}}<includeonly>
# NOT using the old-style parameters
[[Category:{{{1}}}{{{2}}} establishments by country|{{{4|{{{3}}}}}}]]
# So invoke the new core
{{#ifeq:{{{decadeparent}}}|no||[[Category:{{{1}}}0s establishments in {{{3}}}]]}}
-->{{EstcatCountry/core
{{#ifexpr: {{{1}}}0 < 1000 | [[Category:Establishments in {{{3}}} by year|0{{{1}}}]] | [[Category:Establishments in {{{5|{{{3}}}}}} by year]]}}
| year = {{{year|{{Title year}}}}} <!-- allow year param for demonstration purposes -->
[[Category:{{{1}}}{{{2}}} in {{{3}}}|/Establishments]]
| country = {{{1|}}}
{{#if: {{{5|}}} | [[Category:EstcatCountry with newname parameter|{{{4|{{{3}}}}}}]]}}
| sortkey = {{{2|}}}
</includeonly><!--
| newname = {{{3|}}}
# Note {{YearParamUsageCheck}} needs to be available whether or not this template page has been transcluded
| decadeparent = {{{decadeparent|}}}
-->{{YearParamUsageCheck
| yearparam = {{{1}}}{{{2}}}
| nocat={{{nocat|}}}
| min={{{min|}}}
| templatename = EstcatCountry
| dab={{{dab|}}}
}}<noinclude>
}}<!--
<!-- Add categories and interwikis to the /doc subpage, please, not here! -->
# Tracking usage of new versions of the template
{{Documentation}}
-->{{Category other|[[Category:Pages using new version of Template EstcatCountry]]}}<!--
</noinclude>
-->|<!--
# FOUND the old-style parameters
# So invoke the new old template
-->{{EstcatCountry/old|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}<!--
-->|nocat={{{nocat|}}}|decadeparent={{{decadeparent|}}}|dab={{{dab|}}}}}<!--
# Tracking usage of old versions of the template
-->{{Category other|[[Category:Pages using old version of Template EstcatCountry]]}}<!--
-->}}</includeonly><noinclude>
{{Documentation}}<!--
Add categories and interwikis to the /doc subpage, please, not here!
--></noinclude>

Revision as of 07:15, 31 August 2019