Jump to content

Template:Year in continent category and Template:Year in continent category/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
{{CatAutoTOC}}
 
Created page with '<includeonly><!-- # The first step is to check whether this uses the old-style year parameters, of the form {{Year in continent category|1|9|7|3||Europe}} #...'
 
Line 1: Line 1:
<includeonly><!--
<noinclude>{{Distinguish|Template:Year by continent category}}</noinclude><includeonly>{{Year in continent category/core
# The first step is to check whether this uses the old-style year parameters, of the form {{Year in continent category|1|9|7|3||Europe}}
| year = {{{year|{{Title year}}}}} <!-- allow year param for demonstration purposes -->
# The new form is {{Year in continent category|Europe}}
| continent={{#invoke:String|replace|source={{PAGENAME}}|pattern=^%d%d%d%d in |replace=|count=1|plain=false}}
# If it is then all parameters should be passed to the old template ... if not, then use the new core
| nocat={{{nocat|}}}
#
| min={{{min|}}}
# We check this by concatenating the first 4 parameters, and then checking that they are all digits.
}}</includeonly><!--
-->{{#ifeq: {{#invoke:String|match|s={{{1}}}{{{2}}}{{{3}}}{{{4}}}|pattern=^%d%d%d%d?$|start=1|match=1|plain=false|nomatch=%%nomatch%%}}|%%nomatch%%<!--
# Note {{CatAutoTOC}} needs to be available whether or not this template page has been transcluded
-->|<!--
-->{{CatAutoTOC}}<noinclude>
# NOT using the old-style parameters
# So invoke the new core
-->{{Year in continent category/core
| year = {{{year|{{Title year}}}}} <!-- allow year param for demonstration purposes -->
| continent = {{{1|}}}
| nocat={{{nocat|}}}
| min={{{min|}}}
}}<!--
# Tracking usage of new versions of the template
-->{{Category other|[[Category:Pages using new version of Template Year in continent category]]}}<!--
-->|<!--
# FOUND the old-style parameters
# So invoke the new old template
-->{{Year in continent category/old|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|nocat={{{nocat|}}}}}<!--
# Tracking usage of old versions of the template
-->{{Category other|[[Category:Pages using old version of Template Year in continent category]]}}<!--
-->}}</includeonly><noinclude>
{{Documentation}}<!--
{{Documentation}}<!--
Add categories and interwikis to the /doc subpage, please, not here!
Add categories and interwikis to the /doc subpage, please, not here!