Template:External image

From OpenStreetMap Wiki
Jump to navigation Jump to search
[Edit] [Purge] Template-info.svg Template documentation

Usage

This template includes external images to the wiki and allows basic formatting.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
alignmentalignment

alignment of the image and caption on wiki page

Example
right;center;left
Stringoptional
captioncaption

caption of the image

Default
(none)
Example
Click this JOSM button
Unbalanced wikitextoptional
linklink

link in case someone clicks on the image

Default
none
Example
https://josm.openstreetmap.de
URLoptional
URLURL

URL of the image

Example
http://josm.openstreetmap.de/export/15255/josm/trunk/images/bug.png
URLrequired

Application

  • {{external image|URL=http://josm.openstreetmap.de/export/15255/josm/trunk/images/bug.png}}

bug.png

  • {{external image|URL=http://josm.openstreetmap.de/export/15255/josm/trunk/images/bug.png|alignment=right}}
bug.png
  • {{external image|URL=http://josm.openstreetmap.de/export/15255/josm/trunk/images/bug.png|caption=a nice bug icon}}
bug.png
a nice bug icon
  • {{external image|URL=https://tile.openstreetmap.org/15/17875/11359.png|alignment=center|link=https://openstreetmap.org}}
  • {{external image|URL=http://josm.openstreetmap.de/export/15255/josm/trunk/images/audio-prev.svg}}

audio-prev.svg?.png

  • {{button|{{external image|URL=http://josm.openstreetmap.de/export/15255/josm/trunk/images/audio-prev.svg}}}}

audio-prev.svg?.png

Getting the URL of a JOSM icon

Navigate to https://josm.openstreetmap.de/browser/josm/trunk/images. Click on the desired image. In the center of the page, click on Download in other formats and right click on Original Format > Copy link address. Paste the copied URL into the template.

See also

https://www.mediawiki.org/wiki/Manual:$wgAllowExternalImages
MediaWiki configuration info
https://github.com/openstreetmap/chef/blob/40836bb2a0d4d9462d746c78d5084e1c9379bae9/cookbooks/mediawiki/templates/default/LocalSettings.php.erb#L248
Setup for all OSM wikis