Template:Country showdata: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Illegitimate Barrister
No edit summary
meta>SiBr4
Changed {{Str right}} to Lua pattern replacement; finally removed templatename param (see Template talk:Country data#Testing 1–2–3)
Line 80: Line 80:
{{#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 ensign flag variant that can be used with [[Template:Navy]]:
* <code><nowiki>{{navy|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>}}</nowiki></code> → {{navy|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}
* <code><nowiki>{{navy|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{navy|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}
* <code><nowiki>{{flagicon|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>|naval}}</nowiki></code> → {{flagicon|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}|naval}}
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>|naval}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{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 ensign is the same as its national flag, so [[Template:Navy]] produces the following:
* <code><nowiki>{{navy|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>}}</nowiki></code> → {{navy|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}
* <code><nowiki>{{navy|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{navy|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}
}}}}
}}}}
{{#if: {{{flag alias-air force|}}} |
{{#if: {{{flag alias-air force|}}} |
This template includes an air force ensign flag variant that can be used with [[Template:Air force]]:
This template includes an air force ensign flag variant that can be used with [[Template:Air force]]:
* <code><nowiki>{{air force|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>}}</nowiki></code> → {{air force|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}
* <code><nowiki>{{air force|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{air force|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}
* <code><nowiki>{{flagicon|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>|air force}}</nowiki></code> → {{flagicon|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}|air force}}
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>|air force}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}|air force}}
| {{#if: {{{link alias-air force|}}} |
| {{#if: {{{link alias-air force|}}} |
This nation's air force ensign is the same as its national flag, so [[Template:Air force]] produces the following:
This nation's air force ensign is the same as its national flag, so [[Template:Air force]] produces the following:
* <code><nowiki>{{air force|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>}}</nowiki></code> → {{air force|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}
* <code><nowiki>{{air force|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{air force|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}
}}}}
}}}}
{{#if: {{{flag alias-army|}}} |
{{#if: {{{flag alias-army|}}} |
This template includes an army ensign flag variant that can be used with [[Template:Army]]:
This template includes an army ensign flag variant that can be used with [[Template:Army]]:
* <code><nowiki>{{army|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>}}</nowiki></code> → {{army|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}
* <code><nowiki>{{army|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{army|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}
* <code><nowiki>{{flagicon|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>|army}}</nowiki></code> → {{flagicon|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}|army}}
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>|army}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}|army}}
| {{#if: {{{link alias-army|}}} |
| {{#if: {{{link alias-army|}}} |
This nation's army ensign is the same as its national flag, so [[Template:Army]] produces the following:
This nation's army ensign is the same as its national flag, so [[Template:Army]] produces the following:
* <code><nowiki>{{army|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>}}</nowiki></code> → {{army|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}
* <code><nowiki>{{army|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{army|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}
}}}} }}
}}}} }}
{{#if: {{{redir1|}}} |
{{#if: {{{redir1|}}} |
Line 116: Line 116:
}}
}}
===Example usage===
===Example usage===
* <code><nowiki>{{flag|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>}}</nowiki></code> → {{flag|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}
* <code><nowiki>{{flag|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{flag|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}
* <code><nowiki>{{flagicon|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>}}</nowiki></code> → {{flagicon|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}<!--
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}<!--
-->{{#if: {{{shortname alias|}}} |
-->{{#if: {{{shortname alias|}}} |
* <code><nowiki>{{flagcountry|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>}}</nowiki></code> → {{flagcountry|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}} }}
* <code><nowiki>{{flagcountry|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>}}</nowiki></code> → {{flagcountry|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}} }}
{{#if: {{{var1|}}} |
{{#if: {{{var1|}}} |
====Using a flag variant====
====Using a flag variant====
* <code><nowiki>{{flag|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>|</nowiki>{{{var1}}}<nowiki>}}</nowiki></code> → {{flag|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}|{{{var1}}}}}
* <code><nowiki>{{flag|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>|</nowiki>{{{var1}}}<nowiki>}}</nowiki></code> → {{flag|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}|{{{var1}}}}}
* <code><nowiki>{{flagicon|</nowiki>{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}<nowiki>|</nowiki>{{{var1}}}<nowiki>}}</nowiki></code> → {{flagicon|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}|{{{var1}}}}}
* <code><nowiki>{{flagicon|</nowiki>{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}<nowiki>|</nowiki>{{{var1}}}<nowiki>}}</nowiki></code> → {{flagicon|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}|{{{var1}}}}}
}}
}}
{{#if: {{{redir1|}}} |
{{#if: {{{redir1|}}} |
Line 170: Line 170:
{{#ifeq:{{NAMESPACE}}|{{ns:Template}}|<!--
{{#ifeq:{{NAMESPACE}}|{{ns:Template}}|<!--
-->{{#ifeq:{{SUBPAGENAME}}|sandbox|<!--
-->{{#ifeq:{{SUBPAGENAME}}|sandbox|<!--
   -->[[Category:Country data template sandboxes|{{{cat|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}}]]|<!--
   -->[[Category:Country data template sandboxes|{{{cat|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}}]]|<!--
   -->{{#ifexist:{{FULLPAGENAME}}/doc|<!--
   -->{{#ifexist:{{FULLPAGENAME}}/doc|<!--
     -->[[Category:Country data templates with documentation subpage|{{{cat|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}}]]|<!--
     -->[[Category:Country data templates with documentation subpage|{{{cat|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}}]]|<!--
     -->[[Category:Uncategorized country data templates|{{{cat|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}}]]<!--
     -->[[Category:Uncategorized country data templates|{{{cat|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}}]]<!--
     -->}}<!--
     -->}}<!--
   -->{{#if:{{{size|}}}|[[Category:Country data templates with distinct default size|{{{cat|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}}]]<!--
   -->{{#if:{{{size|}}}|[[Category:Country data templates with distinct default size|{{{cat|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}}]]<!--
     -->}}<!--
     -->}}<!--
   -->[[Category:All country data templates|{{{cat|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}}]]<!--
   -->[[Category:All country data templates|{{{cat|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}}]]<!--
   -->{{#if:{{{shortname alias|}}}|<!--
   -->{{#if:{{{shortname alias|}}}|<!--
     -->[[Category:Country data templates with distinct shortname|{{{cat|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}}]]<!--
     -->[[Category:Country data templates with distinct shortname|{{{cat|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}}]]<!--
     -->}}<!--
     -->}}<!--
   -->{{#ifeq:{{PAGENAME}}|Country data {{{alias}}}||<!--
   -->{{#ifeq:{{PAGENAME}}|Country data {{{alias}}}||<!--
     -->{{#ifeq:{{PAGENAME}}|Country data {{{shortname alias}}}||<!--
     -->{{#ifeq:{{PAGENAME}}|Country data {{{shortname alias}}}||<!--
       -->[[Category:Country data templates with distinct template name|{{{cat|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}}}}]]<!--
       -->[[Category:Country data templates with distinct template name|{{{cat|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}}}}]]<!--
       -->}}<!--
       -->}}<!--
     -->}}<!--
     -->}}<!--
     -->{{#if:{{{flag alias|}}}||<!--
     -->{{#if:{{{flag alias|}}}||<!--
       -->[[Category:Country data templates without flag alias|{{{templatename|{{Str right|{{BASEPAGENAME}}|13}}}}}]]<!--
       -->[[Category:Country data templates without flag alias|{{#invoke:String|replace|{{PAGENAME}}|^%w+ data |||false}}]]<!--
       -->}}<!--
       -->}}<!--
   -->}}<!--
   -->}}<!--

Revision as of 18:00, 22 October 2017