Extension:ImageLink

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
ImageLink

Release status: stable

Implementation Parser function
Description
Author(s) Jean-Lou Dupont
Version 1.6.0
MediaWiki 1.8.2, 1.9.3, 1.10, 1.11, 1.12
Download SVN
See SVN ($Id: ImageLink.doc.wikitext 961 2008-04-03 14:43:28Z jeanlou.dupont $)

ImageLink provides a clickable image link using an image stored in the Image namespace or accessible through an interwiki link and an article title (which may or may not existin 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] Usage Note

Please use the #img parser function instead of the older #imagelink one.

[edit] Usage

[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] Event Parameters

Event parameters 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]

require_once( "$IP/extensions/ImageLink/ImageLink.php" );

[edit] PEAR

PEAR is a repository of software code.

pear channel-discover mediawiki.googlecode.com/svn
  • Install extension through PEAR:
pear install mediawiki/ImageLink
  • Add the following to LocalSettings.php[2][3]:
require 'MediaWiki/ImageLink/ImageLink.php';

[edit] Upgrades through PEAR

Sometimes, it is necessary to clear PEAR's cache in order to perform upgrades.

pear clear-cache

or use the force method:

pear upgrade --force mediawiki/ImageLink

[edit] PEAR Web Frontend

For 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 kept up-to-date with this channel, use the following RSS feedImage:Rss2.jpg.

[edit] Notes

  1. The most recent release is always available through the extension's PEAR and SVN repositories. This page is not necessarily up-to-date.
  2. 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.
  3. Modifications to LocalSettings.php is 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

[edit] Sites using this extension

Personal tools
In other languages