Template:Link
Documentation
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages. As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements or fixes, or to voice your opinion.
This template is used to create an internal link. The template rewrites the link to link to the same language subpage of the target page as the language subpage of the source page, if existing. Otherwise fallback to the English version.
See Help:Links for general usage instructions of this template on the wiki.
Parameters
Link to a page that can automatically point to a translated page if it exists
Parameter | Description | Type | Status | |
---|---|---|---|---|
Link | 1 | Internal page link
| String | required |
Section | section anchor | A section of an internal link with a preceding # to designate an anchor. Appending the section to parameter 1 causes the link to break on translated pages.
| String | optional |
Alternate text | 2 | Optional text to replace the page name; use for translations and other context
| String | suggested |
Rationale
On translated pages there is the following problem with internal links. E.g. to link the article "Foo" and the translation of "Foo" doesn't exists right now, the two possibilities are:
- link the English page of "Foo".
- Pro: Link to an available guide.
- Contra: Later, when "Foo" gets translated, the reader is sent to an English page. There they have to select their language again. To save the reader from this hassle, all links to "Foo" in all translated pages have to be changed.
- link the translated page of "Foo" (right now not existing).
- Pro: Later, when "Foo" gets translated, the reader is sent to the translated page.
- Contra: Until "Foo" gets translated, the link is pointing to an non-existing page. The readers has to get active, to even get to the English page.
This template solves this problem.
Usage
See the template's testcases:
Correct
{{Link|Kernel|Gentoo's Kernel information}}
{{Link|Kernel|section=#Emerge|Gentoo's Kernel information}}
See also
The above documentation is transcluded from Template:Link/doc. (edit | history)
Editors can experiment in this template's sandbox (edit) and testcases (edit) pages.
Please add categories and interwikis to the /doc subpage. (See the subpages of this template.)