Difference between revisions of "Template:Country2continent"

From blackwiki
Jump to navigation Jump to search
imported>BrownHairedGirl
(pass through the {{{2nd|}}} parameter, to allow for countries in two continents)
imported>BrownHairedGirl
(format for legibility, and fix passthrough of {{{2nd|}}})
Line 1: Line 1:
<includeonly>{{trim|{{#ifeq:{{str len|{{ISO 3166 code|{{{1}}}}}}}|2|{{Iso2continent| {{ISO 3166 code|{{{1}}}}} }}| {{#if:{{{1|}}}| {{#switch: {{{1}}} | England = Europe | Scotland = Europe | Wales = Europe | Catalonia = Europe | Czechoslovakia = Europe }}}}}}|2nd={{{2nd|}}}}}</includeonly><noinclude>{{documentation}}[[Category:String manipulation templates]][[Category:Country templates]]
+
<includeonly><!--
 +
-->{{trim|<!--
 +
    -->{{#ifeq: {{str len|{{ISO 3166 code|{{{1}}}}}}}<!--
 +
        -->|2<!--
 +
            -->|{{Iso2continent| {{ISO 3166 code|{{{1}}}}} |2nd={{{2nd|}}}}}<!--
 +
            -->|<!--
 +
                -->{{#if:{{{1|}}}<!--
 +
                    -->|{{#switch: {{{1}}}<!--
 +
                        -->| England = Europe<!--
 +
                        -->| Scotland = Europe<!--
 +
                        -->| Wales = Europe<!--
 +
                        -->| Catalonia = Europe<!--
 +
                        -->| Czechoslovakia = Europe<!--
 +
                      -->}}<!--
 +
                -->}}<!--
 +
    -->}}<!--
 +
-->}}<!--
 +
--></includeonly><!--
 +
--><noinclude>{{Documentation}}
 +
[[Category:String manipulation templates]]
 +
[[Category:Country templates]]
 
</noinclude>
 
</noinclude>

Revision as of 05:52, 16 September 2020

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

Combines {{Iso2continent}} and {{ISO 3166 code}} to generate a continent from a country parameter

Usage

{{Country2continent|Countryname}} e.g. *<code><nowiki>{{Country2continent|Benin}}

  • {{Country2continent|England}} → Europe

The optional parameter |2nd=yes is used to generate the second continent, for a country which is in more than one continent, e.g.:

  • {{Country2continent|Russia}}
  • {{Country2continent|Russia|2nd=yes}}

See also