Manual:Linked images

Images on a MediaWiki are designed to almost always link to the description page, so that licensing information, upload history, contributor, and full resolution versions are immediately available. In fact, MediaWiki is designed to prevent manual manipulation of images in wikicode which may circumvent this: The &lt;ima&gt; tag is specifically not whitelisted in the Sanitizer, nor is the background-image CSS attribute.

However, there are several workarounds for those that require them.

Site CSS
The most simplistic method, if your requirements for external images are specialized (that is, restricted to one page or one image), is to add a CSS rule to your MediaWiki:Common.css (or other CSS files, such as MediaWiki:Skinname.css or /skins/skinname/main.css, etc) giving child links of a certain class of object a background image. This method also has some security, as it requires editing the site-wide CSS files, meaning only sysops have access to modify the image shown.

For example (red sections are parts to configure for each image):

In MediaWiki:Common.css: '''.imagelink_ somename a { width: 100 px; height: 100 px; display:block; text-decoration:none; background-image: url(" http://fullurltoimage ") }''' In your wikicode: &lt;div class="imagelink_ somename "&gt; &amp;nbsp; &lt;/div&gt;

This would give the link the background image specified, as well as the width and height of the image (which you have to set manually). To find the location of an uploaded file, go to the image description page and click the image itself, and copy the image location in the address bar.

For example on Image:Wiki.png, the image location is http://upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png (location format will differ depending on local settings), and the width and height would be set to 135px and 135px. So to make a link to the main page here using that logo, one would add to MediaWiki:Common.css: .imagelink_wikilogo a { width:135px; height:135px; display:block; text-decoration:none; background-image: url("http://upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png") } And then use the wikicode: &amp;nbsp;

Whic would give you: 

You can also use a thumbnail of an image, but make sure the thumbnail is being used elsewhere, as most installations are not configured to generate thumbnails on demand.

Redirect
even possible anymore?

External image syntax
If you enable $wgAllowExternalImages (which allows external images from any domain) or $wgAllowExternalImagesFrom (which restricts the list of domains), anyone can then easily create an "external" link to an "external" image. External simply means: using the full URL rather than a local link, so you can link locally, but you need to use the full URL. The plainlinks class is used to remove the "external link" icon:

&lt;span class="plainlinks"&gt; http://linktopage http://linktoimage &lt;/span&gt;

So for example, were external images allowed here, you could link to the main page with http://upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png using wikicode like:

&lt;span class="plainlinks"&gt; http://www.mediawiki.org/wiki/MediaWiki http://upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png &lt;/span&gt;

This has the disadvantage of not registering the link, or the image use, as well as not being easily portable to forks and mirrors.

Raw html
If you enable $wgRawHtml you can use &lt;img&gt; tags freely, but this method is highly insecure.

There are, however, some extensions to make it safer, see Manual:$wgRawHtml for details.

via Extension

 * Extension:LinkedImage
 * Extension:ImageMap
 * Extension:Icon

Allow &lt;img&gt; tag

 * Hack Sanitizer.php
 * parser hook Extension?