Help:Links
<languages/> Template:PD Help Page <translate> There are five types of hypertext links in MediaWiki:
- [[<tvar name=internal>#Internal links</tvar>|Internal links]] to other pages in the same wiki (commonly called "wikilinks")</translate>
<translate>
- [[<tvar name=external>#External links</tvar>|External links]] to pages at other websites</translate>
<translate>
- [[<tvar name=external2>#External links to internal pages</tvar>|External links to internal pages]] in the same wiki</translate>
<translate>
- [[<tvar name=interwiki>#Interwiki links</tvar>|Interwiki links]] to other websites using special prefixes registered in advance</translate>
<translate>
- [[<tvar name=interlang>#Interlanguage links</tvar>|Interlanguage links]] to other wikis registered as different language versions of the current wiki</translate>
<translate> Please note that this list does not include [[<tvar name=h-cat>Special:MyLanguage/Help:Categories</tvar>|category links]] and [[<tvar name=h-img>Special:MyLanguage/Help:Images</tvar>|file links]], which are used to place pages into categories and display images or other media files, respectively. </translate>
<translate>
Internal links
</translate>
<translate> To [[<tvar name=1>Special:MyLanguage/Help:Editing pages</tvar>|create]] a so-called internal link to a page on the same wiki (a "wikilink"), use double square brackets wiki markup, [[like this]].</translate> <translate> When you preview or save your changes, you will see a link that can be followed to the target page.</translate>
<translate> If the page exists the link is displayed in blue (like the word "create" in the first sentence of this paragraph); if the page does not exist, the link appears red (so the [[like this]] link is actually rendered like this). Note that the colors could be different if the color scheme of the wiki has been changed from the default.</translate>
<translate> Following such a "redlink" to a missing page (whether or not it is actually red) will usually enable the user to create the page.</translate>
<translate>
To markup any arbitrary string of text (not necessarily a page title) as a link, use a "vertical bar" or "pipe" character, like this: [[Help:Categories|category links]] results in the link category links.
The first letter of the link target is usually not case-sensitive (unless the wiki is configured otherwise), meaning links can be capitalized or not (so How to contribute and how to contribute are equivalent). However, the case of every subsequent letter must match the target page exactly (so How to contribute and How To Contribute are not equivalent). Spaces in the page title may be represented as underscores (so How to contribute and How_to_contribute are again equivalent), but using underscores in links will make them visible in the page text (but this can be prevented by using a "pipe"). </translate>
<translate> If the page title you are linking to is that of the page you are editing, the result is not a hyperlink at all but simply bold text (for example, on this page the markup <tvar name=1>[[Help:Links]]</tvar> gives the result <tvar name=2>Help:Links</tvar>).</translate>
<translate> If you're trying to create a wikilink to the current page, you probably want to link to a specific section or to an anchor within the page; see the examples below.</translate>
<translate> MediaWiki uses the <tvar name=1>pagelinks</tvar> table to keep track of internal wikilinks. </translate>
| <translate> Name</translate>/<translate> Description</translate> | <translate> Syntax</translate> | <translate> Result</translate> |
|---|---|---|
| <translate> Internal link</translate> | <syntaxhighlight lang="moin">
Extension:DynamicPageList (Wikimedia) </syntaxhighlight> |
|
| <translate> Piped link</translate> |
<syntaxhighlight lang="moin">editing help</syntaxhighlight> <translate> Links to a section/anchor within the target page.</translate> <syntaxhighlight lang="moin">previewing</syntaxhighlight> <translate> Piped link to an anchor on the same page</translate> <syntaxhighlight lang="moin">different text</syntaxhighlight> <translate> See also [[<tvar name=meta>meta:Special:MyLanguage/Help:Piped link</tvar>|meta:Help:Piped link]].</translate> |
|
| Pipe trick | <syntaxhighlight lang="moin">
[[Manual:Extensions|]] [[User:John Doe|]] [[Extension:DynamicPageList (Wikimedia)|]] [[Extension:DynamicPageList (third-party)|]] </syntaxhighlight> <translate> The transformation done by the pipe trick can result in the same text for different link targets, as seen in the DynamicPageList examples.</translate> |
|
| <translate> Word-ending links</translate> | <syntaxhighlight lang="moin">
Helpalmostanylettersyoulikehere HelpBUTnotalways </syntaxhighlight> <translate> Follows so-called "linktrail rules" [[<tvar name=loc>Special:MyLanguage/Localisation</tvar>|localised]] per [[<tvar name=msgxx>Special:MyLanguage/MessagesXx.php</tvar>|each language]].</translate> |
Helpalmostanylettersyoulikehere HelpBUTnotalways |
| <translate> Avoiding word-ending links</translate> | <syntaxhighlight lang="moin">
Helpful advice GPLv3 </syntaxhighlight> |
Helpful advice GPLv3 |
| <translate> Link to an anchor on the same page</translate> | <syntaxhighlight lang="moin">#See also</syntaxhighlight>
<translate> Anchors are provided automatically on [[<tvar name=formatting>Special:MyLanguage/Help:Formatting</tvar>|section headings]] and to the [[<tvar name=1>#top</tvar>|top]] (<tvar name=2> |
#See also |
| <translate> Setting an anchor for incoming links</translate> | <syntaxhighlight lang=html>
optional text
optional text </syntaxhighlight> <translate> Rendered block-level and inline, respectively.</translate>
<translate> Doing this would allow for <translate> Setting an anchor in a section heading </translate> <syntaxhighlight lang=html> Section heading</syntaxhighlight> <translate> Note the placement.</translate> <translate> This must be a "span" tag, not a "div".</translate> <translate> (Such anchors allow sections to be retitled without breaking incoming links.)</translate> |
<div id="<translate nowrap> Unique anchor name 1</translate>"><translate> optional text</translate>
<span id="<translate nowrap> Unique anchor name 2</translate>"><translate> optional text</translate> |
| <translate> Link to an anchor at another page</translate> | <syntaxhighlight lang=moin>Help:Images#Supported media types for images</syntaxhighlight> | Help:Images#Supported media types for images |
| <translate> Link to the current page's talk page</translate> | <syntaxhighlight lang=moin>Discussion</syntaxhighlight>
<translate> See also [[<tvar name=page-names>Special:MyLanguage/Help:Magic_words#Page_names</tvar>|Help:Magic words#Page names]]</translate> |
Discussion |
| Script error: No such module "Loops".<translate> Link to a subpage</translate> | <syntaxhighlight lang=moin>/example</syntaxhighlight>
<translate> Shortcut for <tvar name=1><syntaxhighlight lang="moin" inline>/example</syntaxhighlight></tvar>.</translate> <translate> See also <tvar name=1>Help:Subpages</tvar>.</translate> |
/example |
| <translate> Link to a subpage without the leading slash</translate> | <syntaxhighlight lang=moin>example</syntaxhighlight>
<translate> Shortcut for <tvar name=1><syntaxhighlight lang="moin" inline>example</syntaxhighlight></tvar>.</translate> |
example |
| <translate> Link to a subpage of parent page for current page.</translate> <translate> Can only be used on subpages.</translate> | <syntaxhighlight lang=moin>[[../example2]]</syntaxhighlight>
<translate> Shortcut for <tvar name=1><syntaxhighlight lang="moin" inline>example2</syntaxhighlight></tvar> if you post the link on <tvar name=2><syntaxhighlight lang="moin" inline>example</syntaxhighlight></tvar> page.</translate> |
example2 |
| <translate> Visible link to a category page</translate> | <syntaxhighlight lang=moin>Category:Help</syntaxhighlight>
<translate> Without the leading colon the link would not be visible and the page would instead be placed into the category; this is a very common mistake.</translate> <translate> See also <tvar name=1>Help:Categories</tvar>.</translate> |
Category:Help |
| <translate> Visible link to an image or media file</translate> | <syntaxhighlight lang=moin>
file label </syntaxhighlight> <translate> Without the leading colon on the "File:" examples, the images would actually be displayed.</translate> <translate> See also <tvar name=1>Help:Images</tvar>.</translate> <translate>
The <tvar name=1> |
|
| <translate> Link to a page specific to each reader (user page, etc.)</translate> | <syntaxhighlight lang=moin>
Special:Preferences </syntaxhighlight> |
|
| <translate> Internal link to a specific revision</translate> | <syntaxhighlight lang=moin>Special:PermanentLink/2393992</syntaxhighlight>
<translate> Revision numbers can be found in each page's [[<tvar name=h-hist>Special:MyLanguage/Help:History</tvar>|edit history]].</translate> <translate> (It is very common to see links to specific revisions implemented as external links because it's easy to cut-and-paste an entire URL to form an external link.)</translate> |
Special:PermanentLink/2393992 |
| <translate> Internal link to a "diff"</translate> | <syntaxhighlight lang=moin>
Special:Diff/2390639/2393992 </syntaxhighlight> <translate> The default (in the first example above) is to show the changes from the previous revision.</translate> <translate> See also the comments in the previous item.</translate> |
|
| <translate> Redirect</translate> | #REDIRECT [[Main Page]] <translate> Should be the first and only line on the page.</translate> <translate> See <tvar name=1>Help:Redirects</tvar>.</translate> |
File:Redirect arrow without text (cropped).svg Main Page |
<translate>
External links
To [[<tvar name=h-edit>Special:MyLanguage/Help:Editing pages</tvar>|create]] an external link, usually to a page at a different website, enclose the URL followed by space and the link text in single square brackets (see examples below). When you save or preview the page, you will see a link rendered slightly differently than an internal wikilink. It may be a different color and/or be followed by an arrow icon to show that it may lead to another site. </translate>
| <translate> Description</translate> | <translate> You type</translate> | <translate> You get</translate> |
|---|---|---|
| <translate> External link with specified link text</translate> | [https://mediawiki.org MediaWiki] |
MediaWiki |
| <translate> Numbered external link</translate> | [https://mediawiki.org] <translate> This is what happens if you omit the link text. Multiple links of this type on the same page are numbered sequentially.</translate> |
[1] |
| <translate> Bare external link</translate> | https://mediawiki.org <translate> URLs beginning with "<tvar name=1> |
https://mediawiki.org |
| <translate> Avoiding auto-linked URLs</translate> | <syntaxhighlight lang=html>https://mediawiki.org</syntaxhighlight> | https://mediawiki.org |
| <translate> Protocol-relative external link</translate> | [//en.wikipedia.org Wikipedia] [//en.wikipedia.org //en.wikipedia.org] <translate> The link will be <tvar name=code1>HTTP</tvar> or <tvar name=code2>HTTPS</tvar> depending on the protocol of the page currently being viewed (which could be different for different users).</translate>
<translate> This is only supported inside of square brackets <tvar name=code3> |
|
| <translate> External link to the current server</translate> | https://{{SERVERNAME}}/pagename
|
https://interesting-times.frost.cx/pagename |
| <translate> External link to other host passing the pagename</translate> | https://google.com/search?q={{PAGENAMEE}}
<translate> See also: [[<tvar name=encoded>Special:MyLanguage/Help:Magic_words#URL_encoded_page_names</tvar>|URL encoded page names]]</translate>, Manual:PAGENAMEE encoding |
https://google.com/search?q=Links |
| <translate> Mailto link</translate> | [mailto:info@example.org email me] |
email me |
| <translate> Mailto named with subject line and body</translate> | [mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info] |
info |
| <translate> Custom URI</translate> | [skype:echo123 call me] <translate> Any URI you wish to add needs to be first declared through <tvar name=UrlProtocols>$wgUrlProtocols</tvar>.</translate> <translate> (This example is not enabled on MediaWiki.org)</translate> |
[skype:echo123 call me] |
<translate>
External links to internal pages
To add a link to a page on the same wiki using URL query parameters, you may need to use external link syntax. </translate>
| <translate> Description</translate> | <translate> You type</translate> | <translate> You get</translate> |
|---|---|---|
| <translate> External link to the current page's edit page</translate> | [https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]
[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page]
<translate> See also [[<tvar name=url-data>Special:MyLanguage/Help:Magic_words#URL_data</tvar>|Help:Magic_words#URL_data]] and [[<tvar name=external>#External links</tvar>|External links]] above.</translate> |
|
| <translate> External link to the current page's edit page, and styled to look like an internal link</translate> | <syntaxhighlight lang=html>Edit this page</syntaxhighlight>
<translate> The plainlinks class can be used in cases where you want an external link to look like an internal one, by suppressing the icon that normally appears after it.</translate> |
Edit this page |
<translate>
Limitations
</translate>
- <translate> External links doesn't support Word-ending links.</translate>
- <translate> External links doesn't count toward <tvar name=1>Special:WhatLinksHere</tvar> ([[<tvar name=2>Special:MyLanguage/Help:What links here</tvar>|What links here]]).</translate>
<translate>
Interwiki links
</translate>
<translate> Interwiki links are internal-style links to other websites (which do not have to be wikis, despite the name).</translate>
<translate> For example, you can link to the article https://en.wikipedia.org/wiki/Sunflower by typing [[wikipedia:Sunflower]] or, on this wiki, the shorter [[w:Sunflower]].</translate>
<translate> Both will result in a link wikipedia:Sunflower.</translate>
<translate> This works because by default MediaWiki configures wikipedia: as an "interwiki prefix" that turns into https://en.wikipedia.org/wiki/ when used inside [[ ]].</translate>
<translate> (It may not work if the admin of your wiki has changed the setting.) Unlike internal links, interwiki links do not use page existence detection, so an interwiki link will appear blue even if the page does not exist on the remote wiki.</translate>
<translate>
Similar to internal page links, you can create piped links, with alternate link label, e.g. [[wikipedia:Sunflower|big yellow flower]] is the link big yellow flower and [[wikipedia:Sunflower|]] is the link Sunflower.
Basically, interwiki links are abbreviations for commonly-used longer external links. A very similar link could be created as [https://en.wikipedia.org/wiki/Sunflower big yellow flower].
More details are at <tvar name=2>Manual:Interwiki</tvar> and m:Help:Interwiki linking. Your wiki may have a Special:Interwiki page listing the interwiki prefixes it supports; Template:Git file. You can edit the <tvar name=1>interwiki</tvar> table on your site.
Interlanguage links
If your wiki has other language versions, you may find [[<tvar name=mainill>Special:MyLanguage/Interlanguage_links</tvar>|interlanguage links]] in the [[<tvar name=sidebar>Special:MyLanguage/Help:Navigation#Sidebar</tvar>|sidebar]], just below [[<tvar name=toolbox>Special:MyLanguage/Help:Navigation#Toolbox</tvar>|toolbox]] in a section titled “<tvar name=1>in other languages</tvar>.” </translate>
<translate> In wiki markup an interlanguage link looks very much like an interwiki link, but behaves similarly to a [[<tvar name=1>Special:MyLanguage/Categorylinks</tvar>|category link]] in that it is rendered in a special way.</translate> <translate> While category links appear in a special list at the bottom of the page (usually), interlanguage links appear in a special list in the [[<tvar name=1>Special:MyLanguage/sidebar</tvar>|sidebar]] of the page (or elsewhere, depending on the wiki's configuration and the [[<tvar name=2>Special:MyLanguage/Manual:Skins</tvar>|skin]] used).</translate>
<translate> The purpose of interlanguage links is to link pages on the same topics in different languages.</translate> <translate> To create an interlanguage link, type {{<tvar name=1>tmpl|0=[[$1:$2]]</tvar>|language prefix|page name}} anywhere in the page (preferably at the bottom, like category links); the language prefix is the prefix specified at your wiki for the other language version (typically the ISO 639-1 language code).</translate>
<translate> The interlanguage link is unilateral, it does not point back from that page in the other language.</translate>
<translate> For that purpose, an equivalent back-link needs to be placed there as well.</translate>
<translate> It does not work like the "Edit links" in the languages section of Wikipedia-language versions.</translate>
<translate> But it can be used across all name spaces, including 'User:' to point to ones other profiles in other languages.</translate>
<translate> If you want to make the interlanguage link appear at a specific place in the content of the page rather than in the sidebar, add a colon before the language prefix:
[[:en:Sunflower]]→ en:Sunflower
When a link is both interwiki and interlanguage, the order is wikipedia:en:Sunflower.
For more information, see [[<tvar name=meta>m:Help:Interwiki linking#Interlanguage links</tvar>|m:Help:Interwiki linking#Interlanguage links]].
Limits
An internal wiki link is limited by maximum page title size.
See also
</translate>
[[Category:Help{{#translation:}}|Links]] [[Category:Link{{#translation:}}|Links]]
