Jump to content

Template talk:Flag

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

[edit]

Without such an option, this is a violation of MOS:OVERLINK, particularly in a table with multiple links to the same country. Thanks! 1980fast (talk) 22:08, 18 September 2023 (UTC)[reply]

 Not done {{flagu}} already exists to not link to the country. * Pppery * it has begun... 22:24, 18 September 2023 (UTC)[reply]
Thank you! I was completely unaware of its existence. I'm not sure how I managed to miss it while looking in the documentation, but I appreciate your pointing it out nonetheless! 1980fast (talk) 07:32, 19 September 2023 (UTC)[reply]

Fatah

[edit]

How does this work and why is it not working for Fatah / Fatah? Most other newsworthy Palestinian factions seem to work - Hamas - PFLP - DFLP - but not the biggest. Does it pull a flag off the wiki page for a thing? Or is there a separate database? Does the flag on the page need to be a particular file format or size? Irtapil (talk) 13:51, 17 December 2023 (UTC)[reply]

Yes, it attempts to pull a flag out of a template, which does not exist for Fatah but does for the others. See Wikipedia:WikiProject_Flag_Template#Implementation for information about creating/implementing the flag system for Fatah. Primefac (talk) 14:06, 17 December 2023 (UTC)[reply]
I don't see how any of these flags satisfy MOS:SOVEREIGNFLAG, so why do we have templates for them at all? 2A00:23C5:BA8A:BF01:9B6:5525:7FD6:7C51 (talk) 22:48, 27 January 2024 (UTC)[reply]

Edit request 21 January 2025

[edit]

Description of suggested change:

The flag of Syria has been updated on that page and on other prominent locations such as Syria. It should be updated here as well for consistency. — Preceding unsigned comment added by Jhpratt (talkcontribs) 10:45, 21 January 2025 (UTC)[reply]

 Not done: it's not clear what changes you want to be made. Please mention the specific changes in a "change X to Y" format and provide a reliable source if appropriate. I thought the redirect was accurate; what has changed and what needs changing? Primefac (talk) 12:28, 21 January 2025 (UTC)[reply]
Frankly, I don't even know if I'm asking this in the right place. It was incredibly difficult to find the relevant page, and this quite possibly isn't it.
As to what I'm asking to have changed; the flag of Syria changed with the toppling of the Assad regime. Rather than the red-white-black flag with two stars, the green-white-black flag with three stars is now used. Anywhere these mini icons are used still uses the old flag, which is no longer accurate. I can't provide a diff because of the aforementioned difficulty — I don't even know where these icons are stored.
jhpratt (talk) 07:18, 22 January 2025 (UTC)[reply]
I think you might need to go to Commons; File:Flag of Syria.svg is currently pointing to the two-star file but we can't do anything about that here. Primefac (talk) 09:02, 22 January 2025 (UTC)[reply]
Looking at the discussion there, it appears as though there's some hiccups regarding changing the redirect. Thanks for the information! jhpratt (talk) 08:06, 23 January 2025 (UTC)[reply]

Mobile collapsible sections

[edit]

It seems the present template prevents the collapse of sections on mobile devices. Does anyone suspect why? See, for example, Futsal. fgnievinski (talk) 20:37, 25 May 2025 (UTC)[reply]

Why do you think that it is this template that is causing that issue? Primefac (talk) 23:17, 25 May 2025 (UTC)[reply]
It was collapsing well just before the inclusion of flags: [1] (to be viewed on a mobile screen or simulated so with Ctrl+Shift+I on Chrome). fgnievinski (talk) 03:48, 26 May 2025 (UTC)[reply]
For me it starts not-collapsing in the subsequent diff, Special:Diff/1025223390; the diff you link has {{flag}} and appears to be working correctly. I suspect there is something else weird being done, but I honestly don't have time right now to look, but I'll do so when I get home from work. Primefac (talk) 09:21, 28 May 2025 (UTC)[reply]
The version that works has <!-- MobileFormatter took 0.118 seconds --> in the html source, the version that doesn't does not, which suggests to me that MobileFormatter is having trouble processing the version that doesn't work. Bawolff (talk) 02:49, 29 May 2025 (UTC)[reply]
Looks like this is because $wgMFMobileFormatterOptions['maxImages'] is set to disable collapsible sections if there is more than 1000 images on a page. Bawolff (talk) 03:04, 29 May 2025 (UTC)[reply]
Okay, so it's less that this template is being used, and more that it's being used 1000+ times on the page. Primefac (talk) 15:33, 7 June 2025 (UTC)[reply]

Template-protected edit request, June 28, 2025

[edit]

This is to fix the behavior of the non-breaking spaces between the images and the text of this template. Most browsers don't render a non-breaking space next to an image as expected — see my sandbox, where changing the window width should show the behavior I'm talking about. A similar request was implemented for {{Icon link}} (Module:Icon) last year. Here's the change to be made:

<span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt=|link=]]&nbsp;{{#switch:{{{flag alias}}}|Flag of Switzerland.svg|Flag of the Vatican City.svg|Flag of Switzerland (Pantone).svg|Flag of Vatican City State - 2023 version.svg=&nbsp;}}{{#ifeq:{{{alias}}}|Nepal|&nbsp;&nbsp;}}</span>[[{{{alias}}}|{{{name}}}]]
+
<span class="flagicon nowrap">[[File:{{{flag alias-{{{variant}}}|{{#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt=|link=]] {{#switch:{{{flag alias}}}|Flag of Switzerland.svg|Flag of the Vatican City.svg|Flag of Switzerland (Pantone).svg|Flag of Vatican City State - 2023 version.svg=&nbsp;}}{{#ifeq:{{{alias}}}|Nepal|&nbsp;&nbsp;}}</span>[[{{{alias}}}|{{{name}}}]]

Let me know if you have any questions! TechnoSquirrel69 (sigh) 06:57, 28 June 2025 (UTC)[reply]

{{done}} Primefac (talk) 10:45, 28 June 2025 (UTC) Reverted per subsequent post. Primefac (talk) 13:44, 28 June 2025 (UTC)[reply]
This edit has caused obscure Linter errors in a few pages. See my sandbox for a current set of examples, copied from another page. The help page says One simple solution would be add a whitespace character after the span in the affected template. Would that work here? Maybe one of the zero-width space character templates would be useful if we don't want more actual whitespace. – Jonesey95 (talk) 13:29, 28 June 2025 (UTC)[reply]
@Jonesey95: Thanks for your input! Maybe this is something I'm doing wrong on my end, but I can't reproduce this error. My sandbox still has transclusions of {{Flag/core/sandbox}}, but Special:PageInfo doesn't show me any errors for the page. Also, I've used similar markup in the {{DCWC participant}} template, and I don't see any errors for that either. Could you elaborate on how you came across this? TechnoSquirrel69 (sigh) 14:30, 28 June 2025 (UTC)[reply]
It doesn't seem to cause the error all the time, but the current version of User:Jonesey95/sandbox causes the error when it is put into Special:ExpandTemplates. The problem is described on the help page: the parser can't figure out where to put spaces when the spans are jammed together. I removed spaces from User:TechnoSquirrel69/sandbox, but for some reason, the error doesn't show up. I clearly don't understand the Linter criteria for flagging this error condition, but it is showing up at User:Nomoskedasticity when the above version is used. – Jonesey95 (talk) 15:10, 28 June 2025 (UTC)[reply]
Hmm, the other theory I wanted to test was that it was caused by the indirect way that {{Flag}} transcludes {{Flag/core}}. However, I didn't encounter the error on your sandbox — which is using {{Flag/sandbox}} — on Nomoskedasticity's user page, or on my sandbox. I checked through PageInfo, ExpandTemplates, and Special:LintErrors. Also, as I mentioned in the original post, {{Icon link}} has been using this kind of markup for some time now and I'm not able to find any errors on pages that use it either.
I've gone ahead a reactivated the edit request — Primefac, if you're also unable to find the issue, would you be willing to implement it again? This seems to be a relatively minor error even if it crops up, but I can keep an eye on it and troubleshoot if it happens again. TechnoSquirrel69 (sigh) 17:30, 28 June 2025 (UTC)[reply]
 Done Primefac (talk) 20:37, 28 June 2025 (UTC)[reply]
Thanks! Checking Special:LintErrors/tidy-whitespace-bug this morning and it is indeed populating pages where {{Flag}} is throwing this error. I'm trying to track down where in the process the error is occurring (possibly through the country data template family) but it might take a minute since LintErrors doesn't update immediately every time I save my sandbox. Maybe we could try a &#x200B; (zero-width space) like Jonesey95 suggested? TechnoSquirrel69 (sigh) 03:25, 29 June 2025 (UTC)[reply]
Well, Anomalocaris seems to have worked some magic to those pages, and the errors are now gone — thanks, Anomalocaris! TechnoSquirrel69 (sigh) 05:18, 29 June 2025 (UTC)[reply]
I saw Special:LintErrors/tidy-whitespace-bug lint errors, and experimentally, it seemed that inserting a space before the flag template made the error go away, so I went with that in 2018 Qingdao SCO summit, List of wars involving Canada, User talk:Benlisquare, and User:Nomoskedasticity/TravelTable. I hope I didn't introduce any unwanted side-effects. —Anomalocaris (talk) 05:28, 29 June 2025 (UTC)[reply]
Quite the opposite, you removed the unwanted side-effects caused by my edit to this template! Thanks again, and I'll look out for this in the future as I'm planning to make similar changes to related templates like {{Flagg}} as well. TechnoSquirrel69 (sigh) 05:32, 29 June 2025 (UTC)[reply]