Extension:ImageLink
|
ImageLink Release status: stable |
|
|---|---|
| Implementation | Parser function |
| Description | Creates a clickable image link using an image in an article. |
| Author(s) | Jean-Lou Dupont |
| Last version | 1.7.1 |
| MediaWiki | 1.8+ |
| License | No license specified |
| Download | SVN See SVN ($Id: ImageLink.doc.wikitext 1198 2008-07-14 10:34:54Z jeanlou.dupont $) |
|
Check usage (experimental) |
|
Creates a clickable image link using an image in an article and an article title. This image can be either stored in the Image namespace or accessible through an interwiki prefix. The article title may or may not exist in the database.
The extension also supports the link-less mode thereby enabling a one-stop solution for both link and link-less requirements.
Furthermore, the extension also supports events but only on edit protected pages.
Lastly, the extension provides the parser function #iconlink which provides a clickable URL with the site's favicon.ico as image.
Contents |
[edit] General note
This extension is needed for MediaWiki installations until version 1.13.x.
However, since MediaWiki version 1.14+, a parameter "link=" can be added to any image, without the need to install an extension. But only basic functionality of this extension was integrated into MediaWiki software 1.14+. Some HTML attributes and all of the event attributes are still not part of the MediaWiki software.
[edit] Usage
[edit] Note
Please use the #img parser function instead of the older #imagelink one.
[edit] Local Image
- {{#imagelink: image-page-name | page name |alternate text | width | height | border }}
- {{#img: image=image-page-name [|page=page-to-link-to] [|alt=alternate-text] [|height=height-parameter] [|width=width-parameter] [|border=border-parameter] [|title=title-parameter] [|default-image]}}
See W3Schools on IMG tag for more details.
[edit] Link-Less option
If no page name is given, then no anchor (i.e. HTML < a> element) will be generated.
[edit] Default Image
When the parameter image points to a non-existing image page, then default parameter (if specified) is used as image page. Note that for interwiki link, this option is not supported.
[edit] InterWiki accessible Image
- {{#imagelink: interwiki_prefix:image-page-name | page name | alternate text | width | height | border }}
- {{#img: image=interwiki_prefix:image-page-name ... }}
[edit] List of supported HTML attributes
| HTML attribute | Notes |
|---|---|
| target | e.g. target=_blank for opening link in new window |
| alt | |
| height | |
| width | |
| alt | |
| title | e.g. for tooltip functionality |
| border | |
| class |
[edit] Event Attributes
Event attributes supported: onchange, onsubmit, onreset, onselect, onsubmit, onreset, onselect, onblur, onfocus, onkeydown, onkeyup, onkeypress, onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup.
[edit] Examples
- {{#imagelink: New Clock.gif | Admin:Show Time | Current Time | 32 | 32 | 2 }}
- {{#img: image=Star.png | page=Starred Page | height=100% | title=Some starred page }}
- {{#iconlink: site=http://www.yahoo.com | domaincheck=y | target=_blank | content=YAHOO! }}
[edit] Dependency
[edit] Installation
See the Mediawiki Extension table entry "download" above.[1]
[edit] LocalSettings.php
Extension:ExtensionManager: See footnote[2]
- Add the following to LocalSettings.php, if the extension was downloaded from Jean-Lou Dupont's MediaWiki SVN directory (link in the download entry of the table above)[2]:
require_once( "$IP/extensions/ImageLink/ImageLink.php" );
- Since this Extensions is depending on StubManager, add the line after the StubManager include, or else your Wiki won't work.
[edit] PEARPEAR is a repository of PHP software code.
require 'MediaWiki/ImageLink/ImageLink.php';
[edit] Upgrades through PEARSometimes, it is necessary to clear PEAR's cache in order to perform upgrades.
or use the force method:
[edit] PEAR Web FrontendFor easier remote package management, PEAR Frontend WEB can be installed. Installation notes can be found here. An example of the WEB frontend is available here. |
[edit] RSS feed
To keep up-to-date with this channel, use the following RSS feed__
.
[edit] Notes
[edit] Other Extensions From the same author
Consult User Jldupont's page.
- ↑ The most recent release is always available through the extension's PEAR and SVN repositories. This page is not necessarily up-to-date.
- ↑ 2.0 2.1 2.2 Extension:ExtensionManager does not require any modification to LocalSettings.php because ExtensionManager includes the extension.
Note that if PHP code caching is in place (e.g. APC, eAccelerator), then to successfully complete the installation a cache flush might be needed. - ↑ Modifications to
LocalSettings.phpis only necessary if not using Extension:ExtensionManager
[edit] Optional Dependency
The PEAR package Validate can be installed: the extension performs additional sanity check for {{#iconlink}} site parameter.
[edit] History
| Release | Notes |
|---|---|
| 1.3.0 | Addition of parser function #img & addition of title parameter for tooltips |
| 1.4.0 | * Simplified operation (removal of ParserAfterTidy hook) * Added default image functionality |
| 1.4.1 | Minor bug fix |
| 1.5.0 | Added support for event parameters |
| 1.5.1 | Added support for unrestricted event parameters in the MediaWiki namespace |
| 1.6.0 | Added 'content' & 'target' parameters for <a>, added '#iconlink' parser function |
| 1.7.0 | Added URL fragment support i.e. page-to-link-to#section-to-link-to (issue 22) |
| 1.7.1 | Added fix for "#tab=section" |
[edit] Sites using this extension
- author's web site
- wikiants.org - German
- wikiants.org - English
[edit] Changes in Trunk
- Added a space between $content and img in anchor (thanks Mitchelln)
