Template talk:Flag link

PR China broken
Please help For some reason 🇨🇳 works, but does not, even though Template:Country data People's Republic of China exists. I'm not adept at this, so if someone could please fix it, I would appreciate it. -Justin (koavf)·T·C·M 18:14, 9 January 2008 (UTC)
 * I presume you are referring to, not  .  I think you need to understand how this template works before making mass edits like that.   creates a wikilink by appending a string to the country name.  Therefore, your edit would have changed the wikilink from China at the 2007 World Championships in Athletics to People's Republic of China at the 2007 World Championships in Athletics.  Now in this specific instance, the former target article doesn't exist, so no harm would have been done, but in many sporting events, just "China" is used for the PRC.  (In contrast, the Republic of China is called "Chinese Taipei" in most of those same events).  So please look at the context of your AWB edits and skip over sport related ones.  Thanks, — Andrwsc (talk · contribs) 18:39, 9 January 2008 (UTC)

Accessibility improvement for visually impaired readers
editprotected

Currently " 🇮🇳 india " generates " India", which contains a flag of India that links to the India article; the flag has no alt text. This use of a flag doesn't follow the WP:ALT guideline for alt text, which says that every functional image must have alt text. In this case the image is functional only in that it links to India; other than that, it is purely decorative, since it merely repeats what's in the adjacent text. (Purely decorative images don't need alt text, as per WP:ALT).

The problem with this approach is that a visually impaired reader, who is using a screen reader, will hear something like "India link India link". The first "India" links to the India article; the second links to the India national cricket team article. This is pretty confusing. Even for a sighted reader the link to India is pretty confusing.

The simplest way to fix this problem for accessibility is to remove the link to India, so that " 🇮🇳 india " generates " India" instead. This flag doesn't link to anything, and a screen reader will say just "India link", which is much clearer. This is what has been done for other flag templates; please see Wikipedia talk:WikiProject Flag Template . I've done this in the sandbox and have tested the result; please see Template:Cr/testcases. Can you please install the sandbox patch? Thanks. Eubulides (talk) 06:03, 14 August 2009 (UTC)


 * When I crafted the various national team templates in their current form, I thought there was value in having both a link to the respective national team, and a link to the article for the nation itself. I guess not...?  — Andrwsc (talk · contribs) 06:49, 14 August 2009 (UTC)
 * We want high-value links. Country links will be of little use, and even if readers wanted to get to them, they can always click from the high-value cricket article. Dabomb87 (talk) 14:13, 14 August 2009 (UTC)

Other Links
Is there any way I can make (just) the flag, link to somewhere else like for example: 🇺🇸 but instead of linking to United States, I want it to link to Billboard 200 because thats the ranking of highest selling albums in the United States. — QwertLuis (talk · contribs)
 * Not with this template. Just use MediaWiki image syntax, I suppose. — Andrwsc (talk · contribs) 22:53, 13 February 2010 (UTC)

Edit request on 1 August 2013
I have an idea how to align texts after the flagicon.

As you see, the 16px wide flagicon needs in total 7px space to align with the regular 23px flagicons. And the tiny flagicon needs 11px, in the upper right table it is shown as 3px space plus 8px (or two nbsp's). Other options for Flag of Nepal aligning: &#8205; &#8205; =    &#8205;  &#8205; =    &#8205;  &#8205; =    &#8205;  &#8205; =    &#8205;  &#8205; =    &#8205;  &#8205; =  — 6px space on the left and 5px space on the right — this is my favourite &#8205; &#8205; =    &#8205;  &#8205; =    &#8205;  &#8205; =    &#8205;  &#8205; =

So, please edit this template with for SUI & VAT and with. Thanks.

Maiō T. (talk) 21:45, 1 August 2013 (UTC)


 * Best for you to edit the sandbox version - Template:Flaglink/core/sandbox and test it, then we can move it. Sandbox is now the same as the main template.  Ron h jones  (Talk) 23:49, 1 August 2013 (UTC)

Done! The sandbox version is ready to become the regular one. Unfortunately, I do not know how to insert the pxsp's to the left of the flagicon, so I have inserted them on the right side. Nevermind, this looks good too. I killed two birds with one stone. I also added the TBD-icon in accordance with the last week discussion at Village pump (technical). And please edit the template flagright/core with the same style, too. I just created a flagright/core/sandbox. Thanks. Maiō T. (talk) 12:25, 2 August 2013 (UTC)
 * I fixed a bug in the sandbox which caused unmatched tags if the alias parameter wasn't present. I've also made it easier to see how the logic works. Maiō T., could you give me a link to the village pump discussion that you mentioned? I thought that the TBD icon looked a little intrusive, but if there was a consensus for it then I'll put it back in. — Mr. Stradivarius  ♪ talk ♪ 05:18, 5 August 2013 (UTC)
 * Also, to put the spacing before the icon, all you have to do is add another #if statement before the icon starts and put the spacing there. Have a try at doing that and see if it works for you. — Mr. Stradivarius  ♪ talk ♪ 05:20, 5 August 2013 (UTC)
 * I've deactivated the request for now. Please reactivate it when you respond. — Mr. Stradivarius  ♪ talk ♪ 05:08, 7 August 2013 (UTC)

I'm back. In my last contribution I wanted to kill two birds with one stone, but the birds both flew away :–D. Therefore, this time I write it separately. 1 In the village pump discussion that I mentioned, we discussed the replacement of the ugly | code with something nicer, for example "flag of none" or "&nbsp" or "TBD". So I inserted the into the sandbox. In fact you're right, the black&yellow combination is quite intrusive. Now I propose this neutral solution: TO BE DECIDED, because anything is better than the current result. LINK Maiō T. (talk) 16:36, 8 August 2013 (UTC)
 * The correct solution to the "ugly | code", of couse, is not to use templates such as bk without any parameters.  The template documentation clearly states that the first parameter is mandatory.  Garbage in, garbage out.  Forcing this template to emit something like TO BE DECIDED is not generalized for all the situations where the national team templates are mistakenly called without any parameters.  — Andrwsc (talk · contribs) 17:19, 8 August 2013 (UTC)
 * What if I left the first parameter intentionally blank – the result would be TO BE DECIDED . Or there is also the other option: add #if into the flaglink-template – If the first parameter is entered as TBD, then display TO BE DECIDED . Maiō T. (talk) 17:59, 8 August 2013 (UTC)
 * Then you are intentionally misusing the template as it is documented. And as I said already: TO BE DECIDED is not generalized for all the situations where the national team templates are mistakenly called without any parameters. It may be appropriate text for the specific instance on 2013 FIBA Europe Under-16 Championship for Women, for example, but likely not appropriate for every instance where national team templates are used.  And to be honest, I think it's a bit ridiculous to have large sections of the FIBA article filled with empty tables.  What purpose does the empty "Final standings" table serve at this point?  It seems like you want to have as much wiki markup "ready" to be filled in as the tournament progresses, but that makes the article look silly in the meantime.  How much benefit is there in typing   placeholders in advance, rather than typing   when updating the article after a completed game? I object to adding complexity (i.e. a parser function) to this template simply to accomodate that specific mis-use of bkw et. al. — Andrwsc (talk · contribs) 20:39, 8 August 2013 (UTC)
 * I was inspired by Snooker.org – see this external link. What now? Shall I delete all of the scheduled matches until they will be finished? Maiō T. (talk) 23:16, 8 August 2013 (UTC)
 * Comment out the block of unused wiki markup until needed. Trivially easy edit each time, by just changing the endpoints of the comment block.  — Andrwsc (talk · contribs) 06:53, 9 August 2013 (UTC)

2 My another idea was an aligning.

default results (I added France for illustration purposes)
 * 🇫🇷 france regular 23px wide flagicon
 * 16px width; already added one &nbsp, but still needed 3px
 * 🇫🇷 france 23px
 * 🇻🇦 vatican city 16px width; already added one &nbsp, but still needed 3px
 * 🇫🇷 france 23px
 * 12px width; already added two &nbsp's, but still needed 3px
 * 🇫🇷 france 23px
 * 🇦🇱 albania 21px width; needed 2px
 * 🇫🇷 france 23px
 * 🇦🇩 andorra 22px width; needed 1px
 * 🇫🇷 france 23px
 * 20px width; needed 3px
 * 🇫🇷 france 23px
 * 🇫🇴 faroe islands 21px width; needed 2px
 * 🇫🇷 france 23px
 * 🇮🇸 iceland 21px width; needed 2px
 * 🇫🇷 france 23px
 * 🇮🇱 israel 21px width; needed 2px
 * 🇫🇷 france 23px
 * 🇳🇴 norway 21px width; needed 2px
 * 🇫🇷 france 23px
 * 🇸🇲 san marino 20px width; needed 3px
 * 🇫🇷 france 23px

sandbox results (all texts are aligned)

Now it's really ready. The sandbox template is edited and tested. Everybody must agree, the second column looks nicer. Even administrator Andrwsc. Maiō T. (talk) 19:04, 10 August 2013 (UTC)
 * Um, no. I never said that.  Please do not assume what I think.  I happen to think that adding a dozen parser functions to this template is a terrible, terrible solution to the problem you perceive.  The whole point of the current flag template system implementation was that per-flag formatting overrides (i.e. suppress border display, display a different link name for national teams, etc.) are distributed across the per-country templates instead of coded with a large #switch statement (or worse, as a chain of cascading #ifeq statements) in one location.  A superior method of adding spacing to the left and/or right of each icon image would be to add markup only to the country templates that need it (e.g. something like  ) and the formatting templates (like this one) would use those parameters as appropriate.  I would not oppose a change like that, but I do oppose your sandbox version being used permanently here.  — Andrwsc (talk · contribs) 00:29, 11 August 2013 (UTC)
 * Red information icon with gradient background.svg Not done: It seems clear enough to me that there's no consensus to make this edit at this time. Maiō T., I suggest you have a look at Andrwsc's idea of adding code to the country templates instead. Let me know if you get into any difficulties. Best — Mr. Stradivarius  ♪ talk ♪ 03:12, 11 August 2013 (UTC)
 * Andrwsc, first, thank you for your tip (Category:country data templates), because I found there Country data none. That's exactly I needed last week, remember? Now I can use e.g. or , can't I ??? Secondly, your idea to edit tens of country-data articles is terrible, too. Particularly if the edit damages a something else. See these flagbigs:       Switzerland, Nepal and Vatican big flagicons are disrupted because of their country data edits. Maiō T. (talk) 11:55, 11 August 2013 (UTC)
 * Everything was working well until ill-conceived edits like this were made, without taking into account all the intracacies of the flag template system implementation. Take a look at how image borders are handled, by using a different template parameter  instead of messing around with an existing parameter.  — Andrwsc (talk · contribs) 18:06, 11 August 2013 (UTC)
 * A perfect idea! Let's add this parameter " " into the countrydata templates in question. And into flaglink too. Maiō T. (talk) 19:23, 11 August 2013 (UTC)

Ad hoc insertions of spaces for predefined flags don't actually work
Notice the names of Switzerland, Nepal and the Vatican don't line up with others. The (proper) solution is to use as attribute of the flag span, as in the sandbox. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 ☎ 05:33, 6 June 2021 (UTC)

Template-protected edit request on 3 September 2023
Switzerland and Vatican City currently only include previously used flags in this template. Currently Country data Switzerland uses and Country data Vatican City uses. Please update the template to include those 2 flags or to recognise square flags in general so they have an extra space in templates such as flagu. Aris Odi ❯❯❯  talk  07:10, 3 September 2023 (UTC)
 * ✅ * Pppery * it has begun... 21:34, 4 September 2023 (UTC)