Template:ColorLink
Documentation
This template produces a link with the inputted color.
Parameters
Parameter | Function |
---|---|
(first parameter) | The link color. This can be set to an empty string to cause the link to display as its default color. (This default behavior can be useful when using Template:ColorLink as part of other templates where users may or may not specify a link color.) |
(second parameter) | The article to link to |
(third parameter) (optional) | The text in the link
Default: the value of (second parameter) |
Why?
The standard way to color links in MediaWiki is to write
[[article-title|<font color="link-color">link-text</font>]]
,
or
[[article-title|<span style="color: link-color;">link-text</span>]]
.
(The second way is better, since it doesn't rely on the outdated font
tag.)
For example, you could write
[[Matau|<span style="color: green;">Matau</span>]]
to produce Matau.
These methods do not change the actual link color, they just change the color of the text inside the link. As a result, the methods from earlier don't change the link's underline color. This template actually changes the link color, so the underline color is correct.
Examples
{{ColorLink|green|Matau}}
produces Matau.
{{ColorLink|goldenrod|Takanuva|Takua}}
produces Takua.
{{ColorLink||Tahu (Generation 1)|Tahu}}
produces Tahu.