Help:Linked images: Difference between revisions

From Gearhead Wiki
Jump to navigation Jump to search
(Undo revision 6281 by 173.203.92.15 (talk))
(Undo revision 6278 by 210.48.147.2 (talk))
Line 22: Line 22:
This has the disadvantage of not registering the link, or the image use, as well as not being easily portable to forks and mirrors.
This has the disadvantage of not registering the link, or the image use, as well as not being easily portable to forks and mirrors.


se8rBg  <a href="http://ovimwzojydbw.com/">ovimwzojydbw</a>, [url=http://xfpmqnlehdet.com/]xfpmqnlehdet[/url], [link=http://slugduesrhlg.com/]slugduesrhlg[/link], http://pgdoqibhtvan.com/
===Raw HTML===
If you enable {{mediawiki|Manual:$wgRawHtml|$wgRawHtml}}, you can use '''<tt>&lt;img&gt;</tt>''' tags freely, but this method is highly insecure.
 
There are, however, some extensions to make it safer, see {{mediawiki|Manual:$wgRawHtml#Related_Extensions}} for details.


==Via extensions==
==Via extensions==

Revision as of 00:18, 13 September 2010

Images on a MediaWiki wiki are designed to link to the description page, so that licensing information, upload history, contributors, and full resolution versions are immediately available to the user when he or she clicks an image. In fact, MediaWiki is designed to prevent manual manipulation of images in wikicode which may circumvent this operation: The <img> 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.

1.14+

Warning - This version has not been released yet. This feature may be modified or removed before final release.

Native image link support was added in r41727. See b539.

FkSKeO <a href="http://snebrirjqlgh.com/">snebrirjqlgh</a>, [url=http://qofbtpetpsmg.com/]qofbtpetpsmg[/url], [link=http://dqtdjmqfqeoz.com/]dqtdjmqfqeoz[/link], http://omxhmezejqya.com/

Native with configuration change

If you have server access, but do not want to install any extensions, these solutions may work for you.

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:

<span class="plainlinks">[http://linktopage http://linktoimage]</span>

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:

<span class="plainlinks">[{{fullurl:MediaWiki}} http://upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png]</span>

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 <img> tags freely, but this method is highly insecure.

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

Via extensions

If you are willing to install an extension, several extensions have been created to address this issue:

Or you can invent your own linked image syntax, by writing an extension that registers it as a parser hook. See Manual:Tag extensions for information on extending MediaWiki syntax.

Other options

If you want, you can do some more drastic things, such as modify /includes/Sanitizer.php (where the HTML tag whitelist is), and add <img /> to the list of allowed tags.

See also