User:Astaecker/Link

From Gentoo Wiki
Jump to: navigation, search

[{{fullurl:{{{1}}}}} {{{1}}}]

[edit

Documentation

Use this template 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. Else fallback to the english version.

Rationale

On translated pages you have the following problem with internal links. E.g. you want to link the article "Foo" and the translation of "Foo" doesn't exists right now. You can:

  • link the english page of "Foo".
Pro: You link to an available guide.
Contra: Later, when "Foo" gets translated, you're guiding the reader to an english page. There he has to select his language again. To save the reader from this hassle, you have to change all links to "Foo" in all translated pages.
  • link the translated page of "Foo" (right now not existing).
Pro: Later, when "Foo" gets translated, you're guiding the reader to the translated page.
Contra: Until "Foo" gets translated, you're 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

Add this code to the page text
{{User:Astaecker/Link|Kernel}}

Kernel

Simulation a german (de) origin page
{{User:Astaecker/Link|Kernel|lang=de}}
{{User:Astaecker/Link|Main Page|lang=de}}


For a different link text
{{User:Astaecker/Link|Kernel|Linux Kernel}}
Linux Kernel
Note
The above documentation is transcluded from User:Astaecker/Link/doc. (edit | history)
Editors can experiment in this template's sandbox (create) and testcases (create) pages.
Please add categories and interwikis to the /doc subpage. Subpages of this page.