Help:Image Links
From OiWiki
Contents |
Purpose
Provides a clickable image link using an image (either stored in the Image namespace or accessible through an interwiki prefix) 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.
Usage Note
Please use the #img parser function instead of the older #imagelink one.
Usage
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.
Link-Less option
If no page name is given, then no anchor (i.e. HTML < a> element) will be generated.
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.
InterWiki accessible Image
- {{#imagelink: interwiki_prefix:image-page-name | page name | alternate text | width | height | border }}
- {{#img: image=interwiki_prefix:image-page-name ... }}
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 |
Event Attributes
Event attributes supported: onchange, onsubmit, onreset, onselect, onsubmit, onreset, onselect, onblur, onfocus, onkeydown, onkeyup, onkeypress, onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup.
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! }}

