Template:SmallFlag/doc

From OpenStreetMap Wiki
Jump to: navigation, search

Create a small icon displaying by default a flag of a country, territory (or sometimes region or cities) named in English.

Usage

  • 1=RegionName (required) — the name of the country, territory or region (it may also be the name of a project, but you'll need to customize the image).
    {{SmallFlag|RegionName}}

Example

  • France United Kingdom United States
    {{SmallFlag|France}} {{SmallFlag|United Kingdom}} {{SmallFlag|United States}}

Advanced (optional) parameters

  • 2=Image.ext (optional) — allows to override the default name of the image, which is based on parameter 1 Flag of RegionName.svg. Don't specify the leading "File:" or "Image:" namespace which is implied. Specify it if you need to display another type of image (coat of arms, logo, marker icon, photo, etc. or if the wanted image uses another format for its name, or is not available as an SVG image)
    {{SmallFlag|RegionName|Coat of arms of Region.png}}
  • alt=Short description (optional) — allows to override the default description hint, which by default is the same as the RegionName in the 1st parameter. This will also be the default text displayed in a plain-text only browser when the icon cannot be displayed (the generated icon already includes a small horizontal margin but if this is not enough, you can add an HTML-encoded space at start or end of this parameter; in visual browsers that short description will be displayed as an hint bubble only when hovering the icon with the pointing device).
    {{SmallFlag|RegionName|alt=Region, Country}}
  • link=Namespace/Interwiki-code:PageName (optional) — allows to override the target of the generated link which is default the page named RegionName. You can add namespaces or interwiki links if necessary, but you cannot specify an URL. If there's no article to link to, use this parameter but give it an empty value so that no active link will be generated.
    {{SmallFlag|RegionName|link=Help:WikiProject Region, Country}}
    {{SmallFlag|SmallCityName|link=}}
  • size=widthxheightpx (optional) — allows to restrict the maximum size of the image to another value than the 24x18px by default (set the image height to a maximum of 18 pixels, without exceeding the maximum width of 24 pixels). You must specify a unit, and you can restrict the maximum width, or the maximum height, or both simultaneously (the image will be resized to fit in that horizontal or vertical band or in that rectangle, while preserving its aspect ratio. (However bitmap images are not rescaled to sizes larger than their native definition they can only be scaled down. Also downscaling bitmap images gets a correct non fuzzy result only if the the native definition is at least twice larger or if contrasting areas in the image are large enough (if the original image contains thin contrasting lines or isolated dots or patterns and other important details whose contrasting height or width is lower than 3 pixels, these details will look blurred and jagged after downscaling the original bitmap by a division factor between 1 and 2).
    {{SmallFlag|RegionName|size=widthxheightpx}}
  • float=right/left (optional) — allows to override the default floatting mode of the image, which is right by default to move and align the image to the right side of the inner padding box of the current paragraph or block element. You can also specify the value left to move the image to the left side. When displaying multiple icons with the same side, they will stack horizontally from that specified side to the other side, and if they are not the first one along that side of the padding box but don't fit on the remaining width, will wrap below to the nearest vertical position where they can fit. Any other value than left or right will cause the image to be displayed inline (not floatting)
    {{SmallFlag|RegionName|float=left}}
    {{SmallFlag|SmallCityName|float=none}}

See also