Jump to content

Help:链入页面

本頁使用了標題或全文手工轉換
From mediawiki.org
This page is a translated version of the page Help:What links here and the translation is 71% complete.
PD 注意:当您编辑本页面时,即同意以CC0协议授权您的贡献。您可以在公有领域帮助页面找到更多信息。
此頁面的部分舊修訂版本是在知识共享署名-相同方式共享(CC BY-SA)許可下导入的。 只有新的貢獻採用公有領域授權。
PD

在每個页面的工具中,有一個标记为“链入页面”的链接(或者,更普遍的是,以MediaWiki:Whatlinkshere中的文本标记),也被称为反向链接

概述

链入页面的设备列表页面上相同的网站链接到一个特定的页面,或者页面的所有命名空间,或在指定的一。 看到这样的信息,而在任何页面选择链入页面联系。 列出和/或嵌入给定页的页面。 列表首先會按命名空間排序;接著才以页面ID排序,即页面创建日期。[1]

此信息来自pagelinks 表和templatelinks 表。 嵌入给定页面的那些页面都标有MediaWiki:Istemplate的内容(“嵌入”或“包含”);对于这些页面,不会显示它们是否也“链接”到给定页面。 這可視作為m:Query#backlinks

一篇文章的链接列表在很多方面是有用的:

  • 它非常粗略地说明了页面的受欢迎程度。 有许多链接的页面很可能经常被浏览,因此应该是最好的质量。 很少或根本没有链接的页面可能不太受欢迎。
  • 如果一篇文章的主题内容不明确,那么链接到该文章的文章列表可能会提供有用的背景信息。 例如,当看到一个关于“约翰·史密斯”的条目仅提供了他的生卒日期时,查看该文章的链接列表可能会发现他曾获得过奥运会金牌。
  • 有助于正确的消歧义

该功能对不存在的页面也适用(可能存在指向该页面的链接,这使得创建它格外有用)。 链入页面按钮也位于编辑页面上,当点击一个失效链接时就会进入该编辑页面。 例如,要是电影文章与演员相关联,那么即便没有关于某个演员的文章,人们也能找到该演员出演过的电影。

要直接调用链入页面列表,使用如

[[w:Special:Whatlinkshere/John Smith|w:Special:Whatlinkshere/John Smith]]

顯示成w:Special:Whatlinkshere/John_Smith

局限性及解决方法

未列出的有:

还列出了:

  • 对给定页面应用了#ifexist的页面(参见bug 12019

对于指向章节或其他锚点的链接,其确切目标不会显示。 此外,“链入页面”无法仅列出特定章节/锚点的反向链接。[2] 添加“隐藏的外部链接”后,这些功能由链接搜索提供。

替代:

如果需要这样做,可以将该部分拆分出来。 通过嵌入新页面,内容仍然可以显示在原始页面上。 或者,或者作为拆分的准备工作,人们可以创建一个指向某个页面的链接,该页面会重定向到相应部分,而不是直接创建指向该部分的链接。 整页的反向链接列表现在按确切目标排序,但列出的不是目标章节的名称,而是重定向页面的名称。 这也使得在更改某个部分的名称时,更容易保持链接正常工作:只需更改重定向页面的目标,而无需更改链接的源页面。 请注意,重定向消息位于整个页面的顶部,因此通常在目标位置不可见。 这可能是一个优势(重定向消息使目标页面杂乱的缺点很小),也可能是一个劣势。 要在不向上滚动的情况下查看页面名称,请注意浏览器通常会在最顶部的窗口标题中显示该名称,而地址栏则会显示重定向页面的名称以及目标页面上该部分的名称。 另见Help:Linking sections and redirects (此链接本身也是所描述内容的一个示例)。

另请注意,如果由于模板的更改导致页面的链接发生变化,那么该页面的反向链接不会立即更新,而是通过作业队列进行更新

重定向

反向链接功能会显示哪些反向链接是重定向。

重定向的反向链接也会缩进显示在该重定向下方,如果这些反向链接包含一个重定向,那么该重定向的反向链接也会显示(但不会再进一步显示)。

这使其成为查找双重重定向的有用工具,双重重定向无法正常工作,且除特殊应用(见下文)外,最好替换为直接指向最终目标的重定向。

若仅列出指向例如w:Wikipedia:Be bold的重定向,请使用https://en.wikipedia.org/w/api.php?action=query&list=backlinks&bltitle=Wikipedia:Be%20bold&blfilterredir=redirects&bllimit=500或https://tools.wmflabs.org/redirectviews/?project=en.wikipedia.org&platform=all-access&agent=user&range=latest-20&sort=views&direction=1&view=list&page=Wikipedia:Be_bold

包含案例

A到C是否存在链接,这对于反向链接以及相关更改来说都具有相关性。 如果C不存在,则仅反向链接适用。

  • “包含”就是这样被列出的。
  • 即使A到C的链接在A的wikitext中没有明确显示,但由于包含了链接到C的B,那么A到C的链接也算作存在。
  • 如果A调用B,且B中存在一个在noinclude标签内的指向C的链接,那么B会链接到C,但A不会。
  • 如果A调用B,且B中存在一个在includeonly标签内指向C的链接,那么A会链接到C,但B不会。
  • 如果A调用B,且B链接到依赖某个变量或参数的页面C,那么:
    • A是否链接到C,这一问题取决于页面A上变量的值,或者A调用B时所使用的参数。

B是否链接到C,这一问题取决于页面B上变量的值;就参数而言,从页面B的角度来看,该页面可能不会调用有效的页面名称(例如,因为它调用的页面名称包含花括号),因此B不会链接到任何有效的C,或者其链接的名称取决于该参数的默认值。

因此,A到C的链接可能是由于包含了B,即便单独来看,B与C并无链接。 因此,要找出哪些模板导致页面链接到C,仅检查C的反向链接中的模板是不够的。

如果某些页面因包含B而链接到C,那么如果B在C的反向链接列表中,会更加方便。 可以通过在页面B上,在noinclude标签内放置一个恰当的B的使用示例来确保这一点(B包含B,但不会递归)。

否则,像B这样的页面(它会导致包含B的页面链接到C),只能通过查找直接或间接包含在C的这些反向链接页面中的页面来找到。

例子:

Related changes of Help:What links here, What links to Template:H:f Help 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.

If a page is conditionally embedded through #if, #ifeq, #ifexist, #ifexpr, or #switch, it is counted as embedded, even if the condition is not fulfilled

If on page A the name of an embedded page is time-dependent, e.g. {{abc{{CURRENTDOW}}}}, currently giving Template:Abc4, the "链入页面" list of one of the possibly embedded pages shows page A: the current one, or, depending on caching issues, perhaps an older one.

Thus, although the same functionality is obtained with {{#switch:{{CURRENTDOW}}|0={{abc0}}|1={{abc1}}|..}}, these methods differ in whether the seven templates all count as embedded, or just one.

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 "链入页面" of that page

用户样式

本页正文使用body.mw-special-Whatlinkshere选择器。例如,您可以使用如下的CSS代码:

body.mw-special-Whatlinkshere ul { list-style: decimal }

来对返回链接使用有序列表样式。

顺序;查询

"链入页面" sorts by page namespace then id,[1] i.e., by date of creation of the page.

Comparison with m:Query#backlinks and m:Query#embeddedin:

差异显示:

  • Query sorts by function first (backlinks and inclusions), then by page id, "what links here" sorts by page id.
  • Query distinguishes between B being only included in A, and B also being linked from A.
  • Query does not indicate which backlinks are redirects, and does not include their backlinks.
  • Query provides page ids.

另一个区别:

  • 查询允许对指定命名空间进行限制。

{{#dpl:linksto = pagename}} 使用Extension:DynamicPageList3 ,按字母顺序排序产生的反向链接。 其他排序选项也可用。

在反向链接页面列表

You can display all the links to a page directly within a page by embedding the page "Special:Whatlinkshere"; see Help:嵌入 .

This can also be done using any of the Extension:DynamicPageList (消歧义) extensions.

Two extensions, Extension:Semantic MediaWiki(语义 MediaWiki) and 扩展:Cargo , can be used to make more detailed lists of incoming links, grouped by the specific relationship between the two pages, but only for relationships that are encoded via those extensions.

查找页的外部链接

For a given source wiki we can find the external links to any URL with Special:Linksearch (if installed). Thus, in particular, we can find e.g. pages on the English Wikipedia having an external link to this page or even to an old version, an edit or history page, etc. (provided that the parameter "title" comes first): [1] [2]

There is no such feature for interwiki links. This may be a reason to prefer external link style.

Limitations

  1. The special page doesn't account for External links within the same wiki.
  2. The special page doesn't account for Interwiki_links .

注释

  1. 1.0 1.1 phab:T297754生效之前,是以頁面ID排序的
  2. BZ#8955: 列出损坏的章节锚点的特殊页面

参阅