Difference between revisions of "Template:Flag image"
imported>Great Brightstar (Undid revision 912302889 by Great Brightstar (talk)) |
imported>Great Brightstar (Fix a regression) |
||
| Line 2: | Line 2: | ||
|center|none= tnone | |center|none= tnone | ||
|left= tleft | |left= tleft | ||
| − | |#default= tright}}"><div class="thumbinner" style="width: {{#if:{{{Width|}}}|{{#if:{{{NoBorder|}}}|{{{Width|}}}px|{{#expr:{{{Width|}}}+2}}px}}|fit-content;width:-moz-fit-content;width:-webkit-fit-content;}}">[[Image:{{{Image|{{getalias|{{{Country|}}}|flag}}}}}{{#if:{{{NoBorder|}}}|{{!}}center|{{!}}border}}|{{#if:{{{Width|}}}|{{{Width|}}}px|{{{Image_size|210x105px}}}}}]]<div class="thumbcaption{{#if:{{{NoCentering|}}}|| | + | |#default= tright}}"><div class="thumbinner" style="width: {{#if:{{{Width|}}}|{{#if:{{{NoBorder|}}}|{{{Width|}}}px|{{#expr:{{{Width|}}}+2}}px}}|fit-content;width:-moz-fit-content;width:-webkit-fit-content;}}">[[Image:{{{Image|{{getalias|{{{Country|}}}|flag}}}}}{{#if:{{{NoBorder|}}}|{{!}}center|{{!}}border}}|{{#if:{{{Width|}}}|{{{Width|}}}px|{{{Image_size|210x105px}}}}}]]<div class="thumbcaption" {{#if:{{{NoCentering|}}}||style="text-align:center"}}>{{{Caption|{{#if:{{{Country|}}}|Flag of {{{Country}}}}}}}}</div></div></div>{{#ifeq:{{{Pos}}}|center|</div>}}</includeonly><noinclude> |
{{Doc}} | {{Doc}} | ||
</noinclude> | </noinclude> | ||
Revision as of 06:31, 27 September 2019
Usage
This template generates a floating flag image. Use the parameter |Image= to specify an image without "File:"/"Image:" prefix, |Pos= to control the position of the image (left, right, none or center; default right), |Image_size= to control the image size (default 210×105px), |Width= to specify image width (integer only, without any unit or suffix), |Box_width= to specify the width of the box (integer only, without any unit or suffix), |Caption= to specify the text underneath the image, and |NoCentering= to make the text not centered underneath the image. The parameter |Country= may be used to use the image specified by Template:Country data {{{Country}}} (overridden by the |Image= parameter if specified) and to generate a default caption "Flag of {{{Country}}}". Parameter names are fully case-sensitive.
Examples
Code:
{|
|{{Flag image|Country=Denmark}}
|{{Flag image|Image=Flag of Germany.svg|Caption=Flag of Germany}}
|{{Flag image|Country=Nepal|NoBorder=yes}}
|{{Flag image|Country=Russia|Image_size=120px}}
|}
Output:
| The above documentation is transcluded from Template:Flag image/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |