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
[[Natalie Breez|<span style="color: green;">Natalie Breez</span>]]
to produce Natalie Breez.
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|Natalie Breez}}
produces Natalie Breez.
{{ColorLink|goldenrod|Daniel Rocka|Rocka}}
produces Rocka.