Jump to content

Template talk:Flagicon image

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

This is an old revision of this page, as edited by OwenBlacker (talk | contribs) at 15:09, 10 July 2012 (Requested edit: forcing width: Reopened, with a better explanation of why I'm asking.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

WikiProject iconFlag Template
WikiProject iconThis template is within the scope of WikiProject Flag Template, a collaborative effort to improve and manage Wikipedia's flag icon templates and related resources. If you would like to participate or have any questions, please visit the project page.

Requested edit: forcing width

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)[reply]

no Declined. Per Template:Flagicon/core, the default width for the flagicon template (22x20px) is already the default width here. For example:
United Kingdom {{flagicon|United Kingdom}}
{{flagicon image|Flag of the United Kingdom.svg}}
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)[reply]
recycle 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)[reply]