Difference between revisions of "Template:Country showdata"

From Railway Operation Simulator Wiki
Jump to navigation Jump to search
w>Frietjes
(add optional |demopagename= for testing in testcases)
 
m (1 revision imported)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
<includeonly>__NOEDITSECTION__
 
<includeonly>__NOEDITSECTION__
{{documentation|content=<code>Template:{{{demopagename|{{PAGENAME}}}}}</code> is an internal data container not intended to be transcluded directly. It is used indirectly by templates such as <code>[[Template:flag|flag]]</code>, <code>[[Template:flagicon|flagicon]]</code>, and others.
+
{{documentation|content=
 +
{{#if:{{{hatnote|}}}|{{{hatnote}}}}}
 +
{{#ifeq:{{#invoke:High-use|num|x|demo={{ROOTPAGENAME}}}}|many||{{High-use|demo={{ROOTPAGENAME}}}}}}
 +
{{notice|image=Exclamationdiamond.svg|<code>Template:{{{demopagename|{{PAGENAME}}}}}</code> is an internal data container not intended to be transcluded directly. It is used indirectly by templates such as <code>[[Template:flag|flag]]</code>, <code>[[Template:flagicon|flagicon]]</code>, and others.}}
  
 
{{ombox|text=This template is within the scope of '''[[Wikipedia:WikiProject Flag Template|WikiProject Flag Template]]''', a collaborative effort to maintain flag templates on Wikipedia.  A more thorough discussion of the flag template system, including parameters not described here, can be found on the project page.}}
 
{{ombox|text=This template is within the scope of '''[[Wikipedia:WikiProject Flag Template|WikiProject Flag Template]]''', a collaborative effort to maintain flag templates on Wikipedia.  A more thorough discussion of the flag template system, including parameters not described here, can be found on the project page.}}
  
 
[[File:{{{flag alias|Flag of None.svg}}}|thumb|{{#if:{{{flag link|}}} | See also: [[{{{flag link}}}]] | {{#ifexist: Flag of {{{alias}}} | See also: [[Flag of {{{alias}}}]] | }} }}]]
 
[[File:{{{flag alias|Flag of None.svg}}}|thumb|{{#if:{{{flag link|}}} | See also: [[{{{flag link}}}]] | {{#ifexist: Flag of {{{alias}}} | See also: [[Flag of {{{alias}}}]] | }} }}]]
 +
 
===Standard parameters===
 
===Standard parameters===
 
<table class="wikitable">
 
<table class="wikitable">
Line 26: Line 30:
 
</tr></table>
 
</tr></table>
 
{{#if: {{{var1|{{{flag alias-naval|{{{flag alias-marines|{{{flag alias-military|{{{flag alias-coast guard|{{{flag alias-navy|{{{flag alias-air force|{{{flag alias-space force|{{{flag alias-army|}}}}}}}}}}}}}}}}}}}}}}}}}}} |
 
{{#if: {{{var1|{{{flag alias-naval|{{{flag alias-marines|{{{flag alias-military|{{{flag alias-coast guard|{{{flag alias-navy|{{{flag alias-air force|{{{flag alias-space force|{{{flag alias-army|}}}}}}}}}}}}}}}}}}}}}}}}}}} |
 +
 
===Flag variants===
 
===Flag variants===
 
{{#if:{{{flag link|}}} | {{details|{{{flag link}}}}} | {{#ifexist: Flag of {{{alias}}} | {{details|Flag of {{{alias}}}}} | }} }}
 
{{#if:{{{flag link|}}} | {{details|{{{flag link}}}}} | {{#ifexist: Flag of {{{alias}}} | {{details|Flag of {{{alias}}}}} | }} }}
Line 80: Line 85:
 
-->{{#if: {{{flag alias-army|}}} | <tr><td><code>army</code></td><td style="text-align:center;">[[File:{{{flag alias-army}}}|40px|{{{border-army|{{{border|border}}}}}}]]</td><td><code>{{{flag alias-army}}}</code></td></tr> }}<!--
 
-->{{#if: {{{flag alias-army|}}} | <tr><td><code>army</code></td><td style="text-align:center;">[[File:{{{flag alias-army}}}|40px|{{{border-army|{{{border|border}}}}}}]]</td><td><code>{{{flag alias-army}}}</code></td></tr> }}<!--
 
--></table>
 
--></table>
 +
}}
 +
{{#if: {{{redir1|}}} |
 +
 +
===Redirect aliases===
 +
This template can also be used via an ''alias'' name (implemented as a redirect to this template):<!--
 +
--><table class="wikitable"><!--
 +
--><tr><th>Alias name</th><th>{{tlx|flag|''alias''}} output</th><th>{{tlx|flagcountry|''alias''}} output</th></tr>
 +
{{#if: {{{redir1|}}} | <tr><td><code>{{{redir1}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir1}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir1}}}}}</td><td>{{flagcountry|{{{redir1}}}}}</td></tr> }}<!--
 +
-->{{#if: {{{redir2|}}} | <tr><td><code>{{{redir2}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir2}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir2}}}}}</td><td>{{flagcountry|{{{redir2}}}}}</td></tr> }}<!--
 +
-->{{#if: {{{redir3|}}} | <tr><td><code>{{{redir3}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir3}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir3}}}}}</td><td>{{flagcountry|{{{redir3}}}}}</td></tr> }}<!--
 +
-->{{#if: {{{redir4|}}} | <tr><td><code>{{{redir4}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir4}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir4}}}}}</td><td>{{flagcountry|{{{redir4}}}}}</td></tr> }}<!--
 +
-->{{#if: {{{redir5|}}} | <tr><td><code>{{{redir5}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir5}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir5}}}}}</td><td>{{flagcountry|{{{redir5}}}}}</td></tr> }}<!--
 +
--></table>
 +
See [{{fullurl:Special:WhatLinksHere/{{FULLPAGENAMEE}}|hidelinks=1&hidetrans=1}} What links here] for a full list of redirects.
 +
}}
 +
 +
===Example usage===
 +
* <code><nowiki>{{flag|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{flag|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
 +
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}<!--
 +
-->{{#if: {{{shortname alias|}}} |
 +
* <code><nowiki>{{flagcountry|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{flagcountry|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}} }}
 +
{{#if: {{{var1|}}} |
 +
 +
====Using a flag variant====
 +
* <code><nowiki>{{flag|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>|</nowiki>{{{var1}}}<nowiki>}}</nowiki></code> → {{flag|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|{{{var1}}}}}
 +
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>|</nowiki>{{{var1}}}<nowiki>}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|{{{var1}}}}}
 +
}}
 +
{{#if: {{{redir1|}}} |
 +
 +
====Using a redirect alias====
 +
* <code><nowiki>{{flagicon|</nowiki>{{{redir1}}}<nowiki>}}</nowiki></code> → {{flagicon|{{{redir1}}}}}
 +
* <code><nowiki>{{flagcountry|</nowiki>{{{redir1}}}<nowiki>}}</nowiki></code> → {{flagcountry|{{{redir1}}}}}
 +
* <code><nowiki>{{flag|</nowiki>{{{redir1}}}<nowiki>}}</nowiki></code> → {{flag|{{{redir1}}}}}
 
}}
 
}}
 
{{#if: {{{flag alias-naval|}}}{{{link alias-naval|}}}{{{flag alias-air force|}}}{{{link alias-air force|}}}{{{flag alias-space force|}}}{{{link alias-space force|}}}{{{flag alias-army|}}}{{{link alias-army|}}}{{{flag alias-coast guard|}}}{{{link alias-coast guard|}}}{{{flag alias-military|}}}{{{link alias-military|}}}{{{flag alias-marines|}}}{{{link alias-marines|}}} |
 
{{#if: {{{flag alias-naval|}}}{{{link alias-naval|}}}{{{flag alias-air force|}}}{{{link alias-air force|}}}{{{flag alias-space force|}}}{{{link alias-space force|}}}{{{flag alias-army|}}}{{{link alias-army|}}}{{{flag alias-coast guard|}}}{{{link alias-coast guard|}}}{{{flag alias-military|}}}{{{link alias-military|}}}{{{flag alias-marines|}}}{{{link alias-marines|}}} |
 +
 
===Military ensigns===
 
===Military ensigns===
 
{{#if: {{{flag alias-naval|}}} |
 
{{#if: {{{flag alias-naval|}}} |
This template includes a naval ensign flag variant that can be used with [[Template:Navy]]:
+
This template includes a naval flag variant that can be used with [[Template:Naval]]:
* <code><nowiki>{{navy|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{navy|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
+
* <code><nowiki>{{naval|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{naval|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|naval}}
 
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>|naval}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|naval}}
 
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>|naval}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|naval}}
 
| {{#if: {{{link alias-naval|}}} |
 
| {{#if: {{{link alias-naval|}}} |
This nation's naval ensign is the same as its national flag, so [[Template:Navy]] produces the following:
+
This nation's naval flag is the same as its national flag, so [[Template:Naval]] produces the following:
* <code><nowiki>{{navy|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{navy|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
+
* <code><nowiki>{{naval|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{naval|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
 
}}}}<!--
 
}}}}<!--
 
-->{{#if: {{{flag alias-air force|}}} |{{break}}
 
-->{{#if: {{{flag alias-air force|}}} |{{break}}
Line 124: Line 163:
 
}}}}<!--
 
}}}}<!--
 
-->{{#if: {{{flag alias-navy|}}} |{{break}}
 
-->{{#if: {{{flag alias-navy|}}} |{{break}}
This template includes a navy flag variant that can be used with [[Template:Naval]]:
+
This template includes an ensign flag variant that can be used with [[Template:Navy]]:
* <code><nowiki>{{naval|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{naval|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
+
* <code><nowiki>{{navy|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{navy|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|navy}}
 
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>|navy}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|navy}}
 
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>|navy}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|navy}}
 
| {{#if: {{{link alias-navy|}}} |{{break}}
 
| {{#if: {{{link alias-navy|}}} |{{break}}
This nation's navy flag is the same as its national flag, so [[Template:Naval]] produces the following:
+
This nation's navy flag is the same as its national flag, so [[Template:Navy]] produces the following:
* <code><nowiki>{{naval|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{naval|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
+
* <code><nowiki>{{navy|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{navy|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
 
}}}}<!--
 
}}}}<!--
 
-->{{#if: {{{flag alias-coast guard|}}} |{{break}}
 
-->{{#if: {{{flag alias-coast guard|}}} |{{break}}
Line 147: Line 186:
 
* <code><nowiki>{{army|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{army|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
 
* <code><nowiki>{{army|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{army|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
 
}}}} }}
 
}}}} }}
{{#if: {{{redir1|}}} |
 
===Redirect aliases===
 
This template can also be used via an ''alias'' name (implemented as a redirect to this template):<!--
 
--><table class="wikitable"><!--
 
--><tr><th>Alias name</th><th>{{tlx|flag|''alias''}} output</th><th>{{tlx|flagcountry|''alias''}} output</th></tr>
 
{{#if: {{{redir1|}}} | <tr><td><code>{{{redir1}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir1}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir1}}}}}</td><td>{{flagcountry|{{{redir1}}}}}</td></tr> }}<!--
 
-->{{#if: {{{redir2|}}} | <tr><td><code>{{{redir2}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir2}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir2}}}}}</td><td>{{flagcountry|{{{redir2}}}}}</td></tr> }}<!--
 
-->{{#if: {{{redir3|}}} | <tr><td><code>{{{redir3}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir3}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir3}}}}}</td><td>{{flagcountry|{{{redir3}}}}}</td></tr> }}<!--
 
-->{{#if: {{{redir4|}}} | <tr><td><code>{{{redir4}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir4}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir4}}}}}</td><td>{{flagcountry|{{{redir4}}}}}</td></tr> }}<!--
 
-->{{#if: {{{redir5|}}} | <tr><td><code>{{{redir5}}}</code> (<span class="plainlinks">[{{fullurl:Template:Country data {{{redir5}}}|redirect=no}} view]</span>)</td><td>{{flag|{{{redir5}}}}}</td><td>{{flagcountry|{{{redir5}}}}}</td></tr> }}<!--
 
--></table>
 
See [{{fullurl:Special:WhatLinksHere/{{FULLPAGENAMEE}}|hidelinks=1&hidetrans=1}} What links here] for a full list of redirects.
 
}}
 
===Example usage===
 
* <code><nowiki>{{flag|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{flag|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}
 
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}}<!--
 
-->{{#if: {{{shortname alias|}}} |
 
* <code><nowiki>{{flagcountry|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{flagcountry|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}}} }}
 
{{#if: {{{var1|}}} |
 
====Using a flag variant====
 
* <code><nowiki>{{flag|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>|</nowiki>{{{var1}}}<nowiki>}}</nowiki></code> → {{flag|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|{{{var1}}}}}
 
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}<nowiki>|</nowiki>{{{var1}}}<nowiki>}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{{demopagename|{{PAGENAME}}}}}|^%w+ data |||false}}|{{{var1}}}}}
 
}}
 
{{#if: {{{redir1|}}} |
 
====Using a redirect alias====
 
* <code><nowiki>{{flagicon|</nowiki>{{{redir1}}}<nowiki>}}</nowiki></code> → {{flagicon|{{{redir1}}}}}
 
* <code><nowiki>{{flagcountry|</nowiki>{{{redir1}}}<nowiki>}}</nowiki></code> → {{flagcountry|{{{redir1}}}}}
 
* <code><nowiki>{{flag|</nowiki>{{{redir1}}}<nowiki>}}</nowiki></code> → {{flag|{{{redir1}}}}}
 
}}
 
 
{{#if: {{{related1|}}} |
 
{{#if: {{{related1|}}} |
 +
 
===Related templates===
 
===Related templates===
 
Please see the following related <code>country_data</code> templates:
 
Please see the following related <code>country_data</code> templates:
Line 257: Line 268:
 
* [[Template:Country data {{{related39}}}]]<span style="position:absolute; left:33em;">{{flag|{{{related39}}}<!-- {{#if:{{{related39param|}}}|{{!}}{{{related39param}}}}} -->}}</span> }}<!--
 
* [[Template:Country data {{{related39}}}]]<span style="position:absolute; left:33em;">{{flag|{{{related39}}}<!-- {{#if:{{{related39param|}}}|{{!}}{{{related39param}}}}} -->}}</span> }}<!--
 
-->}}
 
-->}}
 +
 
{{#ifeq:{{SUBPAGENAME}}|sandbox||{{#ifexist:{{FULLPAGENAME}}/doc |
 
{{#ifeq:{{SUBPAGENAME}}|sandbox||{{#ifexist:{{FULLPAGENAME}}/doc |
 
{{#if:{{Suppress categories|{{{{FULLPAGENAME}}/doc}}}}|
 
{{#if:{{Suppress categories|{{{{FULLPAGENAME}}/doc}}}}|
 +
 
===Other information===
 
===Other information===
 
}}
 
}}

Latest revision as of 20:22, 25 January 2023