Template talk:Flagicon image
Flag Template | ||||
|
Requested edit: forcing width
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please replace the contents of the template from:
<span class="flagicon">[[File:{{{1|Flag of None.svg}}}|{{{size|22x20px}}}|{{{border|border}}} |alt=|link=]] </span><noinclude>{{documentation}}</noinclude>
(line break added for legibility) to:
<span class="flagicon"{{#if:{{{size|}}}|| style="width: 23px; text-align: center; display: inline-block;"}}> [[File:{{{1|Flag of None.svg}}}|{{{size|22x20px}}}|{{{border|border}}} |alt=|link=]]</span> <noinclude>{{documentation}}</noinclude>
(again, please remove the line breaks, which I have added for legibility).
This will force flags to be the same width as standard {{flagicon}} images, unless |size=
is specified. Thanks! — OwenBlacker (Talk) 15:59, 9 July 2012 (UTC)
- Declined. Per Template:Flagicon/core, the default width for the flagicon template (22x20px) is already the default width here. For example:
- These look identical on my browser. Indeed, if you look at the output of Special:ExpandTemplates you get nearly identical markup, the only difference being the image link and alt text:
<span class="flagicon">[[File:Flag of the United Kingdom.svg|22x20px|border |alt=United Kingdom|link=United Kingdom]]</span>
<span class="flagicon">[[File:Flag of the United Kingdom.svg|22x20px|border |alt=|link=]]</span>
- — Andrwsc (talk · contribs) 18:04, 9 July 2012 (UTC)
- Reopened
- Sorry, I should have been clearer. The problem is not with the normal cases, like the UK flag, but with flag images that are portrait or square in orientation, such as the Heraldic banner of Spain at File:Pendón heráldico de los Reyes Catolicos de 1475-1492.svg.
- If you look at Italian War of 1494–1498, excerpted to the right here, you can see the text lining up in the right-hand column of the infobox for "Kingdoms of Spain" and "Duchy of Milan", where I have applied this span manually, but not for "Papal States", where I have not. The "Duchy of Mantua" text lines up fine, because that flag is landscape-oriented.
- The change I'm proposing should make no difference at all to landscape-orientated flags, but will fix that alignment issue for square flags and portrait flags. An alternative, if you're still not convinced, might be to add another parameter to make such a span be optimal, but then it's more likely to be forgotten and leave misalignment across articles. — OwenBlacker (Talk) 15:09, 10 July 2012 (UTC)
- If it lines up for you, then it needs more testing because it is off by 1 pixel here (Firefox 10.0.5). Also, if this is really an issue, then perhaps the solution should be applied to the other flagicon-inserting templates as well. Anomie⚔ 21:11, 10 July 2012 (UTC)
Proposed fix if empty
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Standard | W/o border | Empty param | No param | |
---|---|---|---|---|
Actual template | [[File:|23x15px|border |alt=|link=]] | |||
Sandbox |
I have created a sandbox version (compare) which better deals with cases in which the first parameter is empty or not defined at all. The latter is currently the case at List of micronations, where many non-free image names were recently semi-automatically commented out, leaving ugly bordered transparent flag images. It's even worse if the first parameter is kept but emptied ({{flagicon image|}}
), which results in wikitext being displayed. The sandbox displays an unbordered transparent image in both cases.
Please update the template from the sandbox or, preferably, reduce to template protection so I can do it myself. SiBr4 (talk) 22:25, 5 December 2014 (UTC)
- I lowered the template's protection. Cheers, LittleMountain5 21:52, 7 December 2014 (UTC)
- Now done. SiBr4 (talk) 08:51, 8 December 2014 (UTC)
No borders alt text
Why do flags with no borders when using "border=no" in the template display the alt text, when hovering over the image, "no" - FugeeCamptalk 00:34, 14 November 2015 (UTC)