Home
Random
Log in
Settings
About Golf FAQ
Disclaimers
Golf FAQ
Search
Editing
Help:Links
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
''<blockquote>This page is largely inspired by [[mediawikiwiki:Help:Links|Help:Links - MediaWiki]]</blockquote>'' There are five types of hypertext links in Golf FAQ: # '''[[#Internal links|Internal links]]''' to other pages in the same wiki (commonly called "wikilinks") # '''[[#External links|External links]]''' to pages at other websites # '''[[#External links to internal pages|External links to internal pages]]''' in the same wiki # '''[[#Interwiki links|Interwiki links]]''' to other websites using special prefixes registered in advance Please note that this list does not include [[category links]] and [[file links]], which are used to place pages into categories and display images or other media files, respectively. __TOC__ == Internal links == To [[create]] a so-called internal link to a page on the same wiki (a "wikilink"), use double square brackets wiki markup, <code><nowiki>[[</nowiki>Like this<nowiki>]]</nowiki></code>.When you preview or save your changes, you will see a link that can be followed to the target page. 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 <code><nowiki>[[</nowiki>Like this<nowiki>]]</nowiki></code> 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. Following such a "redlink" to a missing page (whether or not it is actually red) will usually enable the user to create the page. To markup any arbitrary string of text (not necessarily a page title) as a link, use a "vertical bar" or "pipe" character, like this: <code><nowiki>[[</nowiki>Help:Categories{{!}}category links<nowiki>]]</nowiki></code> results in the link [[Help:Categories|category links]]. The first letter of the link target is not case-sensitive, 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"). 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 <code><nowiki>[[</nowiki>{{FULLPAGENAME}}]]</code> gives the result <[[{{FULLPAGENAME}}]]). 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. == External links == To [[Help:Editing pages|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. {| class="wikitable" !style="width:15%"| Description !style="width:45%"| You type !style="width:40%"| You get |- | External link with specified link text | <pre>[https://mediawiki.org MediaWiki]</pre> | [https://mediawiki.org MediaWiki] |- | Numbered external link | <pre>[https://mediawiki.org]</pre> This is what happens if you omit the link text. Multiple links of this type on the same page are numbered sequentially. |[https://mediawiki.org] |- |Bare external link |<pre>https://mediawiki.org</pre> URLs beginning with "<code>http://</code>" and "<code>https://</code>" are automatically linked, even when no brackets are used. |https://mediawiki.org |- |<span id="How to avoid auto-links">Avoiding auto-linked URLs</span> |<nowiki>https://mediawiki.org</nowiki> |<nowiki>https://mediawiki.org</nowiki> |- |[[w:Protocol-relative URL|Protocol-relative]] external link |<pre> [//en.wikipedia.org Wikipedia] [//en.wikipedia.org //en.wikipedia.org] </pre> The link will be HTTP or HTTPS> depending on the protocol of the page currently being viewed (which could be different for different users). This is only supported inside of square brackets <code><nowiki>[ ]</nowiki></code>. Using "<code>//en.wikipedia.org</code>" by itself ''does not'' result in a link. | [//en.wikipedia.org Wikipedia] [//en.wikipedia.org //en.wikipedia.org] |- |External link to the current server |<pre>https://{{SERVERNAME}}/en/pagename</pre> |https://{{SERVERNAME}}/en/pagename |- |External link to other host passing the pagename |<pre>https://google.com/search?q={{PAGENAMEE}}</pre> See also: [[Special:MyLanguage/Help:Magic_words#URL_encoded_page_names|URL encoded page names]], {{ll|Manual:PAGENAMEE encoding}} |https://google.com/search?q=Links |- | Mailto link |<pre>[mailto:info@example.org email me]</pre> |[mailto:info@example.org email me] |- |Mailto named with subject line and body |<pre>[mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info]</pre> |[mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info] |- |Custom URI |<pre>[skype:echo123 call me]</pre> Any URI you wish to add needs to be first declared through {{ll|Manual:$wgUrlProtocols|$wgUrlProtocols}}. (This example is not enabled on mediawiki.org) |[skype:echo123 call me] |} === Using email links === Email links use <code>mailto:</code> before the address. They're written like this: <code><nowiki>[mailto:anyone@example.org address name]</nowiki></code> (resulting in [mailto:anyone@example.org address name]). If there's no name, the address is automatically numbered, like this: <code><nowiki>[mailto:anyone@example.org]</nowiki></code> becomes [mailto:anyone@example.org]. Addresses without square brackets won't be linked, e.g., anyone@example.com. You can also add a CC using <code><nowiki>[mailto:anyone@example.org?cc=anyone2@example.org address name]</nowiki></code> (resulting in [mailto:anyone@example.org?cc=anyone2@example.org address name]). To add a subject, use <code><nowiki>[mailto:me@me.com?subject=Me] </nowiki></code>" === External links to internal pages === To add a link to a page on the same wiki using [[w:URI scheme | URL query parameters]], you may need to use external link syntax. {| border="1" class="wikitable" id="You type" ! Description {{Anchor|Description}} ! You type ! You get |- | External link to the current page's edit page |<pre> [https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page] [{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page] </pre> See also [[Special:MyLanguage/Help:Magic_words#URL_data|Help:Magic_words#URL_data]] and [[#External links|External links]] above. | [https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page] [{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page] |- | External link to the current page's edit page, and styled to look like an internal link |<span class="plainlinks">[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]</span> The [[Plainlinks | 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. |<span class="plainlinks">[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]</span> |} ===The arrow icon === Some skins add an arrow icon after each external link by default. However, this can be avoided by using class="[[mw:Plainlinks|plainlinks]]". For instance: *<code><nowiki>[http://a a]</nowiki></code> gives [http://a a] *<code><nowiki><</nowiki>span class="plainlinks"><nowiki>[http://a a]</</nowiki>span></code> gives <span class="plainlinks">[http://a a]</span> === Using Linksearch === [[Special:Linksearch]] is a built-in tool that helps find pages linked to a specific URL. Notes: * Avoid including "http://". * The program might not return any results if there is a colon in the URL. * MediaWiki page names in URLs should have underscores instead of spaces. The Linksearch function also requires underscores in URLs. * Linksearch is sensitive to capitalization, multiple underscores, and the use of "index.php". It may not find alternative URLs even if they lead to the same target. Therefore, when creating an external link, it's best to use the canonical form of the URL. If the address bar displays a modified URL after following a link, update the URL in the link accordingly for optimal use of Linksearch. * The list is sorted by URL, using [[Manual:Page naming#Alphabetic order|standard page name order]]. Note that an underscore, unlike a blank space, is alphabetically positioned between "Z" and "a". === Using backlinks === Normally, internal links within a project are easy to spot and useful for finding related pages. But when there's a mix of internal and external links, it can be tricky to track backlinks, it necessitates the use of both "[[Help:What links here]]" and "[[#Linksearch|Linksearch]]". However, for links to specific sections or anchors, it's possible to include both an internal link and, with CSS styling using "display=none" an external link to provide backlink. External links are better than interwiki links. With Linksearch, you can even find backlinks to specific sections or anchors. So, combining both internal and external links while hiding the external ones "<nowiki><span style="display:none">http://...</span></nowiki>", gives us the best of both worlds. === Limitations === # ''External links'' doesn't support ''Word-ending links''. # ''External links'' doesn't count toward <nowiki>Special:WhatLinksHere</nowiki> ([[Special:MyLanguage/Help:What links here|What links here]]). == Interwiki links == Interwiki links are internal-style links to other websites (which do not have to be wikis, despite the name). For example, you can link to the article https://en.wikipedia.org/wiki/Sunflower by typing <code><nowiki>[[wikipedia:Sunflower]]</nowiki></code> or, on this wiki, the shorter <code><nowiki>[[w:Sunflower]]</nowiki></code>. Both will result in a link [[wikipedia:Sunflower]]. This works because by default MediaWiki configures <code>wikipedia:</code> as an "interwiki prefix" that turns into <nowiki>https://en.wikipedia.org/wiki/</nowiki> when used inside <nowiki>[[ ]]</nowiki>. (''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. Similar to internal page links, you can create {{ll|Help:Links#Piped links|piped links}}, with alternate link label, e.g. <code><nowiki>[[wikipedia:Sunflower|big yellow flower]]</nowiki></code> is the link [[wikipedia:Sunflower|big yellow flower]] and <code><nowiki>[[wikipedia:Sunflower|]]</nowiki></code> is the link [[wikipedia:Sunflower|Sunflower]]. Basically, interwiki links are abbreviations for commonly-used longer external links. A very similar link could be created as <code><nowiki>[https://en.wikipedia.org/wiki/Sunflower big yellow flower]</nowiki></code>. == Piped links == <!--T:158--> <!--T:159--> A '''piped link''' is an internal [[Help:Link|link]] or [[Help:Interwiki linking|interwiki link]] where the 'target page name' of the link and its 'label' are both specified. <!--T:160--> This is useful in cases where the user wants to values of 'target page name' and 'label' to be different. <!--T:161--> This also enables linking a contextually relevant word or phrase within the text of a page rather than using the generic value "see also". <!--T:162--> The wording does not need to match the name of the target page. <!--T:163--> Depending on the [[Help:Preferences|preferences]] set for the current user and a supported browser, you can still see the link target: when you hover your cursor over the link, the name shows up in a pop-up window and is also shown in the status bar. <!--T:164--> For example: <pre><nowiki>[[coffeehouse setup|Get Piping Hot Coffee Here!]]</nowiki></pre> will show: [[coffeehouse setup|Get Piping Hot Coffee Here!]] <!--T:165--> Let's take another example: <nowiki>[[help:Piped link|piped link]]</nowiki> will be displayed as [[help:Piped link|piped link]]. <!--T:166--> This can be done when context makes it clear that the page being linked to is in the help namespace. <!--T:167--> The piped link is a better way of doing this, rather than mistakenly linking to [[piped link]] which might be a disambiguation page or not exist. <!--T:168--> Fun Fact: The term ''piped'' refers to the use of the pipe character "<tvar name="1">|</tvar>", which in this context is used to separate the more descriptive description from the actual name of the linked page. <!--T:169--> The Pipe character was named after an alternative use of it; see [[w:en:Pipe (computing)|Pipe (computing)]]. ===Using a redirect as an alternative=== <!--T:170--> <!--T:171--> An alternative way is to use [[Help:Redirect|redirect pages]]. <!--T:172--> To create <tvar name="1">[[Get Piping Hot Coffee Here!]]</tvar>, use <tvar name="2"><nowiki>[[Get Piping Hot Coffee Here!]]</nowiki></tvar> and make it redirect to [[coffeehouse setup]] (please note: unlike above, what pops up when you point at the link, depending on your browser's support, is the text that is already shown). <!--T:173--> It is convenient if the redirect is already there or will also be of use elsewhere. However, there are a few drawbacks. *<!--T:174--> the popup does not show the destination page *<!--T:175--> "[[Help:Related changes|Related changes]]" shows the changes in the ''redirect page'' not the redirect target *<!--T:176--> the redirect message that is shown on the target page slightly clutters it <!--T:177--> Using a piped link and a redirect together, it is possible to provide information in the hover box that is not the name of the linked page, for example, the value of a unit in terms of other units. <!--T:178--> In that case, it is possible to make a page whose page name is the information that you'd like in the link title, and which redirects to the page with a more appropriate name. <!--T:179--> For example, the page [[w:30.48 cm]] redirects to [[w:Foot (unit)]]. == Character conversion == The guidelines outlined in [[m:Help:Page name]] state that in wiki and interwiki links, conversions are made to [[m:Help:Special characters|non-literal characters]] automatically. For example,"<code><nowiki>[[Help:Page%20name]]</nowiki></code>" will display as "[[m:Help:Page name]]". Conversely, external links operate oppositely; literal characters are transformed into non-literal characters. For example, browsers typically convert ".../wiki/!" to ".../wiki/%21". Applying a code like %70 to a redirect deactivates it, even though the link remains accessible from the redirect page. To ensure a successful redirect, the redirect page displays the canonical form of the target, unlike the preview page which shows the link in its regular format. == See also == *[[Special:Mostlinked]] - Displays the number of links. *[[Special:Lonelypages]] - A list of pages not linked to any page. [[Category:Help|Links]] [[Category:Link|Links]]
Summary:
Please note that all contributions to Golf FAQ may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Golf FAQ:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Anchor
(
edit
)
Template:Like this
(
edit
)
Template:Ll
(
edit
)