Template:Click/doc
From MeritBadgeDotOrg
- This documentation is transcluded from Template:Click/doc/doc.
This template may have a sandbox (edit) and testcases for editors to experiment.
This template links an image to a page other than its image description page. It has been updated to avoid the accessibility problems caused by an earlier version.
Contents |
Prerequisites
- MediaWiki 1.14 (rev:41789) or later
Usage
To use this template, simply copy the text below and replace the text between the <...> with the desired result.
{{Click
|image = <image to be linked>
|size = <size of the image>
|width = <width of the image> DEPRECATED
|height = <height of the image, optional> DEPRECATED
|link = <page the image must link to>
|title = <the label for the image, optional>
|desc = <location of a description link, optional> DEPRECATED
}}
- The
imageparameter specifies the image to be used. It defaults to Image:Transparent.gif when not specified. - The
sizeparameter specified the maximum size of the image, either in the format«width»x«height»px,«width»px, orx«height»px. -
TheDEPRECATEDwidthparameter specifies the maximum width the image should be scaled to. It defaults to the default size of the image when not specified. Do not add "px" to the value. -
TheDEPRECATEDheightparameter specifies the maximum height the image should be scaled to. It defaults to the default size of the image when not specified. Do not add "px" to the value. - The
linkparameter specifies the page to which the image should link. It defaults to the Main Page when not specified. - The
titleparameter specifies text to be used in the tooltip (text which appears on hovering the mouse over the image) and as alternative text if the image fails to load. It is entirely optional, and defaults to the text of the title of the page to which the image links. -
TheDEPRECATEDdescparameter specifies a location where an icon linking to the description page for the image can be placed. It is entirely optional, and can take any of the following values:top-right,bottom-right,bottom-left,top-left, ornoneto disable it completely. It defaults tononewhen not specified.
Examples
{{Click
|image = Eagle_Knot.gif
|size = 100x100px
|link = Eagle Scout Rank
}} - Text immediately after and inline
Which will produce:
- Text immediately after and inline
Further examples
{{Click
|image = Eagle_Knot.gif
|size = 100x100px
|title = Eagle Scout
|link = Eagle Scout Rank
}} - Text immediately after and inline
Which will produce:
- Text immediately after and inline
{{Click
|image = Eagle_Knot.gif
|size = 100px
|title = Eagle Scout
|link = Eagle Scout Rank
}} - Text immediately after and inline
Which will produce:
- Text immediately after and inline
{{Click
|image = Eagle_Knot.gif
|size = x100px
|title = Eagle Scout
|link = Eagle Scout Rank
}} - Text immediately after and inline
Which will produce:
- Text immediately after and inline
{{Click
|image = Eagle_Knot.gif
|title = Eagle Scout
|link = Eagle Scout Rank
}} - Text immediately after and inline
Which will produce:
- Text immediately after and inline
{{Click|image = Eagle_Knot.gif|size = 110px|title = Eagle Scout Knot|link = Eagle Scout Rank}} - Text immediately after and inline
Which will produce:
- Text immediately after and inline
Here is a partial example from Scouter Awards. As you move your mouse over an image, the link appears. Click the image and you will go to the article, not the image.
| Arrow of Light, red and green knot, green to right, No. 05018, for use by adult leaders only. The Arrow of Light is the highest award in Cub Scouting and can only be earned as a Webelos Scout. |
