Help:Link: Difference between revisions

Content deleted Content added
An example of the latter is in Template:Pd: although internal link style can be used for a calculation, e.g. google:200/7, external link style like http://www.google.com/search?q=200/7 is needed when
No edit summary
 
(664 intermediate revisions by more than 100 users not shown)
Line 1:
{{MovedToMediaWiki|Help:Links}}
The following types of [[w:hyperlink|hyperlink]] can be distinguished:
 
# internal link in internal link style
# [[interwiki link]] in internal link style
# link in external link style
 
If no link label is specified, 1 and 2 are of the form [[ ''target'' ]] (with in case 2 ''target'' starting with a prefix) and 3 is of the form ''target'' or [ ''target'' ], where ''target'' is the [[w:URL|URL]] including <nowiki>"http://"</nowiki>. In case 3 no blank space is allowed in the URL. For MediaWiki pages the blank space can be replaced by an underscore, in general also %20 can be used; see also [[URLs#URLs in external links|URLs in external links]].
 
A label can be specified with in case 1 and 2 [[ ''target'' | ''label'' ]] and in case 3 [ ''target'' ''label'' ], with a blank space in between, see [[Help:Piped link]].
 
Link type 1 will be a link to the viewing page if the page exists at the time of loading or previewing of the referring page, otherwise to the edit page.
 
Reasons to use type 3 to link to an internal page include:
 
*linking to the edit page of an existing page
*the referring page is a [[template]] and the link target contains a template parameter
 
An example of the latter is in [[Template:Pd]]: although internal link style can be used for a calculation, e.g. [[google:200/7]], external link style like http://www.google.com/search?q=200/7 is needed when parameters are used; it is what we get with <nowiki>{{pd|200|7}}</nowiki>:
 
{{pd|200|7}}.
 
==See also==
 
*[[Help:Editing#Links, URLs]]
*[[Help:Self link]]
*[[Help:Template#Restrictions]] (and the next section)
*[[Help:Calculation]]