Views
Help:Making Links
From Forexpedia
Contents |
[edit] Wikilinks
A wikilink is an internal link to another page within a wiki. Although it is sometimes possible to code these links using HTML, a wiki will often provide its users with a unique markup language that makes creating wikilinks simpler and a lot less time consuming. Such languages are called wikitext languages or wiki markups. The syntax for the wikitext language used by Forexpedia is defined by the software [1].
[edit] Syntax
MediaWiki defines a wikilink as a closed set of inward facing square bracket pairs '[[ ]]'. The link target is the sequence of characters immediately following the first bracket pair until a space, pipe '|', or the opposing bracket pair ']]' is encountered (read from left to right).
| Basic Wikilink Syntax | ||||
| Code | → | Result | Target | Description |
| [[a]] | → | a | a | The simplest wikilink |
| [[a|b]] | → | b | a | Link targets 'a' but displays 'b' * |
| [[a]]b | → | ab | a | 'b' is included at the end of the link text |
| <nowiki>[[a]]</nowiki> | → | [[a]] | Ø | Text is displayed as typed without the properties of a link |
| [[w:Image:Bernanke.jpg|]] | → | Image:Bernanke.jpg | w:Image:Bernanke.jpg | A pipe '|' immediately before the closing bracket pair ']]' hides the first prefix of the link when it is displayed * |
| Wikilink Tricks & Demos | ||||
| [[a|b|c]] | → | b|c | a | The wiki markup treats the second pipe '|' as regular text * |
| [[a|b]]c | → | bc | a | 'c' is included at the end of the link text, targets 'a' * |
| a[[b]] | → | ab | b | 'a' immediately precedes the link text but is not included |
| [[a]]<nowiki>b</nowiki> | → | ab | a | 'b' immediately follows the link text but is not included |
| [[a]]''b'' | → | ab | a | Using double apostrophes '' around 'b' to make it italicized excludes it from the link text |
| ''[[a]]''b | → | ab | a | Using triple apostrophes ''' around 'b' to make it italicized excludes it from the link text |
| [[a|b]]c<nowiki>d</nowiki> | → | bcd | a | Translates like [[a|bc]]<nowiki>d</nowiki> * |
| [[a]][[b]] | → | ab | a,b | Two links next to each other, looks like ab when not hovered over with a cursor |
* Links with parameters (the link name) are said to be "piped" because of the pipe symbol used. See help:piped links
MediaWiki automatically checks if the target of a wikilink exists ("existence detection"). If the page doesn't exist, the link leads to the editing screen, and it is assigned the class "new". Such wikilinks are nicknamed "red links" because they are colored red in the default stylesheet on a default installation of MediaWiki. Red links are useful in determining the current status of the page (created or not created), create links to a future page, facilitates and incites page creation.
Note that the image, category, and interlanguage syntax are the same as the wikilink syntax. Attempting to link normally will place the image on the page, add the page to the category and create an interlanguage link at the edge of the page. This can be prevented by prefixing a colon, which escapes the specific syntax. For example, [[:Category:Help]], [[:fr:Help:Link]], and [[:Image:Mediawiki.png]].
The existence of an internal link from a page to an existing or non-existing page is recorded in the pagelinks table.
[edit] External links
External links use absolute URLs to link directly to any webpage. These links have the associated CSS class "external". External links are in the form [http://www.example.org link name] (resulting in link name), with the link name separated from the URL by a space. Links without link names will be numbered: [http://www.example.org] becomes [2]. Links with no square brackets will be displayed in their entirety: http://www.example.org .
Unlike in the case of internal links, [http://www.example.org a]s gives as.
See URLs in external links for more detailed information.
Special:Linksearch finds all pages linking to a given site.
[edit] External links to the same project
External links are often used to use special URL parameters in links. This allows links directly to the edit history of a page, to a page in edit view, a diff of two versions, et cetera. They can also be used to create a navigational image.
However, the use of external links to link to a normal page on the same project is not recommended. These links benefit from none of the features of a wikilink, and may break the web of links when the content is exported to another domain.
[edit] Problems with page name conversion
Note that if the page name is automatically converted (for example, from "/wiki/main Page" to "/wiki/Main Page"), the section link will still work but will disappear from the address bar. As a consequence, this will make it more difficult to bookmark the section itself. This is not applicable for wikilinks, because the conversions have already taken place on Preview or Save of the referring page.
For example, consider http://en.wikipedia.org/wiki/Wikipedia:how_to_edit_a_page#Links_and_URLs. In this case, the anchor part of the address will disappear because the "how" will be converted to "How".
[edit] Redirects with section links
A redirect to a page section does not go to the section. However, one can add the section anyway as a clarification, and it will work if the redirect is manually clicked from the redirect page. However, links with a section to a redirect will lead to the section on the redirect's page.

