Sablon:IconLink/doc
More actions
Renders an inline icon link: a small icon followed by a text label, where both the icon and the label link to the same wiki page. Suited to compact, scannable references such as a ship with a thumbnail, a manufacturer with its logo, or a location with a map pin. Wraps Module:IconLink; see the module page for rendering details. For an icon beside plain, non-linking text, use Template:IconText.
Usage
The first positional argument is the target page; icon is the file name of the leading glyph. text overrides the visible label (which defaults to the page name); size sets the icon size; class appends a CSS class to the root span.
| Wikitext | Result |
|---|---|
{{IconLink|Aurora MR|icon=CdxIconArticle.svg}}
|
|
{{IconLink|Stanton system|text=Stanton|icon=CdxIconMapPin.svg}}
|
|
{{IconLink|Aurora MR|icon=CdxIconImage.svg|size=16px}}
|
|
{{IconLink|Aurora MR|icon=CdxIconArticle.svg|mask=yes}}
|
Parameters
Renders an inline icon link: a small icon followed by a text label, where both the icon and the label link to the same wiki page. Suited to compact, scannable references such as a ship with a thumbnail, a manufacturer with its logo, or a location with a map pin. Wraps Module:IconLink; see the module page for rendering details. For an icon beside plain, non-linking text, use Template:IconText.
| Paraméter | Leírás | Típus | Állapot | |
|---|---|---|---|---|
| Link | 1 link | Target wiki page. Both the icon and the label link here. Alias: `link` (takes precedence over the positional argument).
| Lapcím | kötelező |
| Icon | icon | File name (without the `File:` prefix) of the leading icon.
| Fájl | kötelező |
| Text | text | Visible label. Defaults to the page name.
| Karakterlánc | nem kötelező |
| Icon size | size | Icon size, as a MediaWiki image size.
| Karakterlánc | nem kötelező |
| Mask icon | mask | Render the icon as a recolorable CSS mask filled with the linked text color, instead of an image.
| Logikai | nem kötelező |
| CSS class | class | Extra class appended to the root span.
| Karakterlánc | nem kötelező |
Behavior
- The icon and the text sit in a single inline-flex span, so they stay on one line with a small gap and align vertically centered.
- The icon is rendered with
class=metadata, which excludes it from MultimediaViewer; clicking it follows the same link as the text. maskswaps the<img>for a CSS mask filled withbackground-color: currentColor, so the icon takes on the linked text color. The masked icon stays wrapped in the link. Provide a single-color (for example Codex) icon for the best result.linkis an accepted alias for the first positional argument. If both are supplied,linktakes precedence.- If
iconis omitted, or if no link is given, the module raises a script error.
See also
- Module:IconLink — implementation.
- Template:IconText — an icon beside non-linking text.