Wikipedia:WikiProject Flag Template/Archive1

From Wikipedia, the free encyclopedia

Template for displaying a tiny flag image. Also shows linked text (probably a country name).

Presently implemented:

The {{country|Action|CountryName}} template is used to display various information about a country.

  • Suggested country code modifiers, using format 'Country_code'-'Modifier':
    • Country_code is the usual country identification code.
    • Modifier is an identification of the specific flag.
    • Examples:
      • {{flag|USA-48}}: Template:Country data USA-48 — the 48-star flag of the United States.
      • {{flag|USA-MN}}: Template:Country data USA-MN — the USA state of Minnesota.
      • {{flag|Russian-SFSR}}: Template:Country data Russian-SFSR — Flag of Russia while member of USSR.
      • {{flag|Brazil-imperial}}: Template:Country data Brazil-imperial — Imperial flag of Brazil.
      • {{flag|Brazil-1889}}: Template:Country data Brazil-1889 — The temporary flag of Brazil for 5 days in 1889.
  • Shortcuts:
    • {{flag}}: {{flag|CountryName}}: Flag icon with text linked to country page. (implemented with country|flag)
    • {{flagicon}}: {{flagicon|CountryName}}: Same as country|flagicon.
    • {{flagIOC}}: {{ISO|CountryName}}: Same as country|flagIOC.
    • {{ISO}}: {{ISO|CountryName}}: Same as country|flagISO.
  • country|flag: {{country|flag|CountryName}}: Flag icon with text linked to country page.
    • Each CountryName is connected to a flag file, a Wikipedia article name, and text label. The flag file and text label are displayed, with a link to the Wikipedia article.
  • country|flagicon: {{country|flagicon|CountryName}}: Flag icon alone.
  • country|flagISO: {{country|flagISO|CountryName}}: Flag icon with text linked to country page; name is an ISO 3166-1 country code.
  • country|flagIOC: {{country|flagIOC|CountryName}}: Flag icon with text linked to country's Olympics page; name is an International Olympic Committee country code (see List of IOC country codes).
    • IOC country code usage:
      1. An IOC country code should be used only for general reference to that country's Olympic activities.
        • At present an IOC country code will create a link to that nation's recent Olympics page, as there is no Olympics page for each country.
      2. Names such as flagIOC-2000 should be used for Games which have detailed coverage. This ensures that links will point to specific Games despite future changes.
        • Templates {{flagIOC-2000}}, {{flagIOC-2002}}, and {{flagIOC-2004}} exist.
      3. Use modified country codes such as RUS-SFSR for historical references to Games where a country's reference has changed (ie, different flag).

Contents

[edit] Template:Flag

  • Implemented by invoking {{country|flag|CountryName}}.
    • Uses sub-templates to alias various names for a country to a specific name.
      • At present, all supported countries must have sub-templates. Need better incantation or create templates.
        • A couple of hundred countries have to be supported, plus aliases.
        • Two/three letter abbreviations for each.
        • Some countries have aliases: US, USA, United States, United States of America.
    • Displays aliased Image file name.
    • Displays aliased text label (ie, "US" is aliased to "USA").
    • Links label to Wikipedia article (ie, "US" is linked to United States)

Names supported during testing:

  • none
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • AUS
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • Australia
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • AUT
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • Austria
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • Belgium
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • Canada
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • Earth
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • Greece
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • ITA
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • Italy
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • POL
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • Poland
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • Turkey
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • US
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • USA
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • United States
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
  • United States of America
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.


[edit] Implementation

The technology being used is called a template array: a group of templates whose names follow patterns which are used to address them. For example, the common programming array address A(1,2) can be represented as Template:array_A_1_2.

Defined template array entries appear in this list: templates starting with country_

Template arrays for these templates follow the convention: country_AliasType_alias_CountryName

  • country_: prefix used by templates related to {{country}}.
  • AliasType: optional indicator of type of alias.
  • _alias_: suffix to indicate end of alias type.
  • CountryName: name of country which is being addressed.
    • CountryName-Modifier is also used, for historical or component references, such as Russian-SFSR to refer to Russia while a member of the USSR, or US-WI to refer to the US state of Wisconsin.

[edit] Aliasing example

Referenced as Template addressed Value in template Usage
US country_alias_US United States Wikipedia article: United States
US country_flag_alias_US Flag of the United States.png Flag:
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
US country_label_alias_US USA Small text label:
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.
US country_shortname_alias_US United States Short country name:
The template {{WikiProject Flag Template/Archive1}} is deprecated. Please use {{Country}} instead.
This usage is deprecated. Please replace it with {{tdeprecated|WikiProject Flag Template/Archive1|Country}}.
The template {{Country}} is deprecated. Please use {{Flag}} instead.

[edit] Old proposal: Template:Flag2

  • Summary: {{flag2}} requires 3 parameters:
    1. name of flag file and template appends _flag_large.png.
    2. Wikipedia article name
    3. Text with which to label link to WP article.


Whatch the pro at work. ;) Ok I should be modest right. Your idea is good. But I suggest something like -> Template:Flag2 usage is Flag2|picture you want|text that you want to see

Ill be adding if-else statements once I comprihed how they work on templates. --Cool Cat My Talk 09:50, 10 Apr 2005 (UTC)

Good idea, but templates do not support if-else. I'm a programmer and would have used them. That is causing some of the difficulties in making the Aliasing work well. You probably were confused by the proposals to include if-else. (SEWilco 18:12, 10 Apr 2005 (UTC))
  • Example of template usage: Template:Country data Us Problem when 3 parameter not defined
  • Example of template usage: Template:Country data Us
  • Example of template usage: Flag of Japan Japan
  • Example of template usage: Flag of France France
  • Of course some links dont work as they shouldnt. --Cool Cat My Talk 10:02, 10 Apr 2005 (UTC)
  • Countriy names folow this general patern(aside from several word countries): First leter capital rest lower case.
    • United States is "Us", as the image is named as so.
That filename oddity in Template:Flag is aliasing, so editors can use several country names or abbreviations. My next testing is in using subst to save the standardized country code, so aliasing does not have to be done always. (SEWilco 18:12, 10 Apr 2005 (UTC))

Plan on makking it like this: Temlate argument 1,2,3 Flag2|1|2|3

  • if 3 not null [[Image: 1 _flag_large.png|20px| 1 ] [[ 2 | 3 ]]
  • else if 2 not null [[Image: 1 _flag_large.png|20px| 1 ] [[ 2 ]]
  • else if 1 not null -> [[Image: 1 _flag_large.png|20px| 1 ] [[ 1 ]]
  • else -> Earth flag. --Cool Cat My Talk
    • I was tempted to make Default be the Yellow Jack, the quarantine flag. :-) (SEWilco)
    • You've noticed by now there is no IF and no default. As it was, it was tricky making a Null flag do something, and that was just a bit of sillyness as few people use Null arguments. (SEWilco)
    • Don't try too hard to make Flag do everything. I'll explain shortly a more general viewpoint. (SEWilco)
    • There are Template sandboxes. "If you with to experiment with templates (and not have your experiments deleted before you are done with them), you may do so in the TemplateSandbox. You may also use the templates X1, X2, and X3 for experimental purposes." (SEWilco)

Well, This way you do not need 1 page per flag. My template works better I think as its more generic. The if else structure would make it perfect. --Cool Cat My Talk 06:07, 11 Apr 2005 (UTC)

    • I am well aware it doesnt exist. I am suggesting what I want to do. We can trick the system you know :) --Cool Cat My Talk 12:29, 11 Apr 2005 (UTC)

[edit] Old proposal: Template:Flag4

  • Summary: {{flag4}} requires 3 parameters:
    1. name of flag file and template appends _flag_large.png.
      • Parameter 1 is also assumed to be the link to a Wikipedia article.
    2. Text with which to label link to WP article.

By Pioneer-12 :

My entry into the flag sweepstakes. An adaption of Template:Flag2 by the skillful Coolcat. I think this is the most flexable flag template yet. It displays a flag and optionally displays companion text.

Usage: {{Flag4|country|companion text (optional)}}

Examples:

  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4
  • Template:Flag4 Template:Flag4 Template:Flag4 Template:Flag4 Template:Flag4 Template:Flag4 Template:Flag4 Template:Flag4 Template:Flag4 Template:Flag4 Template:Flag4 Template:Flag4

[edit] Finding flag images

Note to people working on this:

[edit] Future development

I am using the template array technology. There are proposed technologies which may be better. (SEWilco 05:46, 9 Jun 2005 (UTC))