Aide:What links here

Révision datée du 6 septembre 2005 à 10:05 par RKM (discussion | contributions)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

Every page has a link labelled "What links here" (or, more generally, labelled with the text in mediawiki:whatlinkshere), also called backlink

Limitation

Not listed are subpages that just have an automatic link to a page.

Redirects

The backlinks feature shows which backlinks are redirects.

The backlinks of the redirect are also shown, and if they include a redirect, the backlinks of that also (not more).

This makes it a useful tool for finding double redirects, which do not work, and, except in special applications (see below) can better be replaced by redirects to the final target.

Cases of

Whether there is a link from A to C is relevant for backlinks as well as Related changes. If C does not exist, only backlinks are applicable.

  • in the case of a template, referral to it is treated as link
  • a link from A to C counts as such even if the link is not explicit in the wikitext of A, but due to the inclusion of template B, which links to C
  • if template B calls a template that depends on a variable or parameter, then:
    • the question whether A links to C depends on the value of the variable on page A, or the parameter with which A calls B
    • the question whether B links to C depends on the value of the variable on page B; in the case of a parameter, considered from page B, the page does not call a valid template name (it calls one with a name with braces), so B does not link to any valid C

Thus a link from A to C may be due to the inclusion of template B, even when B, considered by itself, does not link to C. Thus, to find out what templates cause pages to link to C, it is not sufficient to check for templates in the backlinks of C; some templates can only be found by checking what templates are used in the backlink pages.

Examples:

  • Template:H:f calls Template:h:f {{NAMESPACE}}. Considered by itself that is the unused Template:H:f Template [1], [2]
  • This page Help:What links here links through Template:H:f to Template:H:f Help [3], [4]. This page is therefore a backlink of the latter, but Template:H:f is not listed.

Even without a template name depending on a variable or parameter, if page A links to page C due to the inclusion of template B1 which redirects to B2, which links to C, A is in the list of backlinks of C but B1 is not.

Summarizing, for the purpose of backlinks and Related changes, A links to C if there is, in that order, a chain of template calls, a single redirect, template calls, a single redirect, etc., template calls, and a chain of redirects.

In the case of an image, using it in a page is listed in the third section of the image description page, but not in "What links here" of that page

Other uses

The backlinks facility works also for a page that does not exist. The What links here button is also on the edit page on which one arrives when following a broken link.

The feature can also be applied to itself and other special pages, e.g. [5], [6], [7], [8].

Links could be put specially for use with "What links here", as an alternative category system, even to non-existing pages, e.g. Altcat:Help 1, see Special:Whatlinkshere/Altcat:Help 1. Putting the wikitext [[Altcat:Help 2| ]] does not provide a link and only produces a blank space (perhaps depending on the browser, here it produces " "), but for "What links here" it works as a link, see Special:Whatlinkshere/Altcat:Help 2. This could be useful for a special-purpose category that should not clutter the regular list of categories a page belongs to (for example, on w:en: there is the requirement that when viewing an article in a category, it is obvious why the article is in the category, and the requirement that the category subject is prominently discussed in the article).

Similarly an empty template can be used: {{:Altcat:Help 3}} displays as "Altcat:Help 3"; see Special:Whatlinkshere/Altcat:Help 3.

Also a link can be provided, alongside the pseudo-link, [[Altcat:Help 2| ]][[Special:Whatlinkshere/Altcat:Help 2|Help 2]] gives " Cat:Help 2", or in the template: {{:Altcat:Help 4}} gives "Altcat:Help 4".

Except in the case that the link is put in the template (it can also be put alongside the template tag), a redirect can specify a supercategory. As opposed to actual categories, the backlinks can show a tree structure: not only pages and subcategories, but also the contents of the subcategories (for each a list of pages and a list of sub-subcategories) and the contents of the sub-subcategories (for each a list of pages and a list of sub-sub-subcategories), but not the contents of the sub-sub-subcategories, up to three levels are shown; see Cat:Help and Cat:Municipalities of the Netherlands.