Difference between revisions of "Template:EstcatCanadaprovince"

From blackwiki
Jump to navigation Jump to search
imported>BrownHairedGirl
({{Portal|{{{3}}}|Years|{{#invoke: FindYDCportal | findydcportal |{{{1}}}{{{2}}} }}}})
imported>BrownHairedGirl
(make parameterless)
Line 1: Line 1:
<includeonly>{{Portal|{{{3}}}|Years|{{#invoke: FindYDCportal | findydcportal |{{{1}}}{{{2}}} }}}}
+
<includeonly>{{Category other
Organizations, places or other things established in {{CanadaProvinceThe|{{{3}}}}}'''[[{{{3}}}]]''' in the year '''[[{{{1}}}{{{2}}}]]'''.
+
    |<!--
{| class="toccolours" style="margin:1em auto;"
+
      # It is a category, so proceed
|[[:Category:{{{1}}}0s establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}0s establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}]]:  
+
      # First check that this page's title is of the format "YYYY establishments in Foo"
|{{LinkCatIfExists2|{{#expr: {{{1}}}0 - 1}} establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|&larr;}} {{LinkCatIfExists2|{{{1}}}0 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}0}} • {{LinkCatIfExists2|{{{1}}}1 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}1}} • {{LinkCatIfExists2|{{{1}}}2 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}2}} • {{LinkCatIfExists2|{{{1}}}3 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}3}} • {{LinkCatIfExists2|{{{1}}}4 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}4}} • {{LinkCatIfExists2|{{{1}}}5 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}5}} • {{LinkCatIfExists2|{{{1}}}6 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}6}} • {{LinkCatIfExists2|{{{1}}}7 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}7}} • {{LinkCatIfExists2|{{{1}}}8 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}8}} • {{LinkCatIfExists2|{{{1}}}9 establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|{{{1}}}9}} {{LinkCatIfExists2|{{#expr: {{{1}}}9 + 1}} establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|&rarr;}}
+
    -->{{#ifeq: {{#invoke:String|match|s={{PAGENAME}}|pattern=^%d%d%d%d establishments in .+$|start=1|match=1|plain=false |nomatch=%%nomatch%%}} |%%nomatch%%<!--
|}
+
      -->|<!--
{{Category see also if exists| {{{1}}}{{{2}}} disestablishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}}}
+
              # Not a valid page
[[Category:{{{1}}}0s establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}]]
+
          -->{{Error|ERROR. [[Template:EstcatCanadaprovince]] is for use only on pages with a title of the form "Category:YYYY establishments in Foo", where YYYY is a 4-digit year.}}<!--
{{#ifexpr: {{{1}}} < 100 | [[Category:Establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}} by year|0{{{1}}}]] | [[Category:Establishments in {{CanadaProvinceThe|{{{3}}}}}{{{3}}} by year]]}}
+
          -->[[Category:Template EstcatCanadaprovince on invalid page]]
[[Category:{{{1}}}{{{2}}} in {{CanadaProvinceThe|{{{3}}}}}{{{3}}}|Establishments]]
+
      -->|<!--
[[Category:{{{1}}}{{{2}}} establishments in Canada|{{{3}}}}]]</includeonly><!--
+
              # A valid page
# Note {{YearParamUsageCheck}} needs to be available whether or not this template page has been transcluded
+
          -->{{EstcatCanadaprovince/core
-->{{YearParamUsageCheck
+
                | year={{#invoke:String|match|s={{PAGENAME}}|pattern=^%d%d%d%d|start=1|match=1|plain=false}}<!--
| yearparam    = {{{1}}}{{{2}}}
+
              -->| province={{#invoke:String|replace|source={{PAGENAME}}|pattern=^%d%d%d%d establishments in t?h?e? ?|replace=|count=1|plain=false}}<!--
| templatename = EstcatCanadaprovince
+
          -->}}<!--
}}<noinclude>
+
    -->}}<!--
 +
-->|<!--
 +
    # Not a category
 +
  -->|{{Error|message=ERROR.  [[Template:EstcatCanadaprovince]] is for use only on category pages}}<!--
 +
  -->[[Category:Template EstcatCanadaprovince on invalid page]]<!--
 +
-->}}</includeonly><noinclude>
 
<!-- Add categories and interwikis to the /doc subpage, please, not here! -->  
 
<!-- Add categories and interwikis to the /doc subpage, please, not here! -->  
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 00:59, 19 February 2019

Template documentation[view] [edit] [history] [purge]

Usage

{{EstcatCanadaprovince}}

No parameters are needed

Error-checking

Misuses are categorised in Category:Template EstcatCanadaprovince on invalid page (population: 0)

See also